fechell 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Manifest +75 -0
- data/README.rdoc +130 -0
- data/Rakefile +16 -0
- data/fechell.gemspec +33 -0
- data/lib/defs/3.00.csv +1 -0
- data/lib/defs/5.00.csv +1 -0
- data/lib/defs/5.1.csv +1 -0
- data/lib/defs/5.2.csv +1 -0
- data/lib/defs/5.3.csv +1 -0
- data/lib/defs/6.1.csv +1 -0
- data/lib/defs/6.2.csv +1 -0
- data/lib/defs/6.3.csv +1 -0
- data/lib/defs/6.4.csv +1 -0
- data/lib/fechell/forms.rb +1285 -0
- data/lib/fechell.rb +353 -0
- data/lib/tests/f3test.rb +1035 -0
- data/lib/tests/satest.rb +346 -0
- data/lib/tests/sbtest.rb +390 -0
- data/lib/tests/sc1test.rb +616 -0
- data/lib/tests/sctest.rb +387 -0
- data/lib/tests/testdata/F3-3.00-32564-SC1.fec +3 -0
- data/lib/tests/testdata/F3-3.00-32777.fec +17 -0
- data/lib/tests/testdata/F3-3.00-32909-SC.fec +3 -0
- data/lib/tests/testdata/F3-3.00-32933-SB.fec +3 -0
- data/lib/tests/testdata/F3-3.00-32933.fec +658 -0
- data/lib/tests/testdata/F3-5.00-97348.fec +410 -0
- data/lib/tests/testdata/F3-5.00-97424-SB.fec +3 -0
- data/lib/tests/testdata/F3-5.00-97424-SC.fec +3 -0
- data/lib/tests/testdata/F3-5.00-97424.fec +12 -0
- data/lib/tests/testdata/F3-5.00-97986-SC1.fec +3 -0
- data/lib/tests/testdata/F3-5.1-116177-SC1.fec +3 -0
- data/lib/tests/testdata/F3-5.1-116437-SC2.fec +370 -0
- data/lib/tests/testdata/F3-5.1-126642.fec +448 -0
- data/lib/tests/testdata/F3-5.1-126655-SB.fec +3 -0
- data/lib/tests/testdata/F3-5.1-126655-SC.fec +3 -0
- data/lib/tests/testdata/F3-5.1-126655.fec +70 -0
- data/lib/tests/testdata/F3-5.2-170434.fec +298 -0
- data/lib/tests/testdata/F3-5.2-170443.fec +5 -0
- data/lib/tests/testdata/F3-5.2-170775-SC.fec +3 -0
- data/lib/tests/testdata/F3-5.2-170890-SC.fec +3 -0
- data/lib/tests/testdata/F3-5.2-170890.fec +21 -0
- data/lib/tests/testdata/F3-5.2-171146-SC1.fec +3 -0
- data/lib/tests/testdata/F3-5.2-171146.fec +490 -0
- data/lib/tests/testdata/F3-5.3-210119-SB.fec +8 -0
- data/lib/tests/testdata/F3-5.3-210119.fec +86 -0
- data/lib/tests/testdata/F3-5.3-210142-SC1.fec +3 -0
- data/lib/tests/testdata/F3-5.3-210142.fec +414 -0
- data/lib/tests/testdata/F3-5.3-210250.fec +584 -0
- data/lib/tests/testdata/F3-5.3-212438-SC.fec +3 -0
- data/lib/tests/testdata/F3-6.1-331453-SB.fec +3 -0
- data/lib/tests/testdata/F3-6.1-331453.fec +414 -0
- data/lib/tests/testdata/F3-6.1-332530-SC.fec +4 -0
- data/lib/tests/testdata/F3-6.1-332675.fec +1140 -0
- data/lib/tests/testdata/F3-6.1-333405-SC1.fec +3 -0
- data/lib/tests/testdata/F3-6.1-333405.fec +199 -0
- data/lib/tests/testdata/F3-6.2-350353-SC.fec +4 -0
- data/lib/tests/testdata/F3-6.2-350353.fec +882 -0
- data/lib/tests/testdata/F3-6.2-350775-SB.fec +3 -0
- data/lib/tests/testdata/F3-6.2-350775.fec +406 -0
- data/lib/tests/testdata/F3-6.2-350844-SC1.fec +3 -0
- data/lib/tests/testdata/F3-6.2-350844.fec +139 -0
- data/lib/tests/testdata/F3-6.3-413014.fec +624 -0
- data/lib/tests/testdata/F3-6.3-413060-SC.fec +3 -0
- data/lib/tests/testdata/F3-6.3-413226-SB.fec +3 -0
- data/lib/tests/testdata/F3-6.3-413226.fec +219 -0
- data/lib/tests/testdata/F3-6.3-413284-SC1.fec +3 -0
- data/lib/tests/testdata/F3-6.4-420048-SC.fec +3 -0
- data/lib/tests/testdata/F3-6.4-420048.fec +325 -0
- data/lib/tests/testdata/F3-6.4-420106.fec +3 -0
- data/lib/tests/testdata/F3-6.4-423088-SC1.fec +3 -0
- data/lib/tests/testdata/F3-6.4-423088.fec +59 -0
- data/lib/tests/testdata/F3-6.4-424094.fec +969 -0
- data/lib/tests/testdata/F3-6.4-424586-SB.fec +4 -0
- data/lib/tests/testdata/F3-6.4-424586.fec +131 -0
- data/lib/tests.rb +6 -0
- metadata +153 -0
data/lib/tests/satest.rb
ADDED
@@ -0,0 +1,346 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "fechell"
|
3
|
+
|
4
|
+
require "fechell/forms"
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
|
8
|
+
|
9
|
+
require 'test/unit/ui/console/testrunner'
|
10
|
+
|
11
|
+
class TC_FECTestScheduleA < Test::Unit::TestCase
|
12
|
+
def setup
|
13
|
+
@testfiles = {}
|
14
|
+
@testfiles["3.00"] = "tests/testdata/F3-3.00-32933.fec"
|
15
|
+
@testfiles["5.00"] = "tests/testdata/F3-5.00-97348.fec"
|
16
|
+
@testfiles["5.1"] = "tests/testdata/F3-5.1-126642.fec"
|
17
|
+
@testfiles["5.2"] = "tests/testdata/F3-5.2-170434.fec"
|
18
|
+
@testfiles["5.3"] = "tests/testdata/F3-5.3-210250.fec"
|
19
|
+
@testfiles["6.1"] = "tests/testdata/F3-6.1-332675.fec"
|
20
|
+
@testfiles["6.2"] = "tests/testdata/F3-6.2-350353.fec"
|
21
|
+
@testfiles["6.3"] = "tests/testdata/F3-6.3-413014.fec"
|
22
|
+
@testfiles["6.4"] = "tests/testdata/F3-6.4-424094.fec"
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_v300
|
26
|
+
h = FECHell.new
|
27
|
+
|
28
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["3.00"])
|
29
|
+
|
30
|
+
h.process(@testfiles["3.00"]) do |line|
|
31
|
+
schedule = line[0]
|
32
|
+
values = line[1]
|
33
|
+
|
34
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
35
|
+
|
36
|
+
|
37
|
+
if schedule == "SA"
|
38
|
+
assert_equal('C00256131', f.committee_fecid)
|
39
|
+
assert_equal('IND', f.entity_type)
|
40
|
+
assert_equal('Ackerley', f.contributor_last_name)
|
41
|
+
assert_equal('Ginger', f.contributor_first_name)
|
42
|
+
assert_equal('4000 E. Denny Blaine PL', f.contributor_street_1)
|
43
|
+
assert_equal('', f.contributor_street_2)
|
44
|
+
assert_equal('Seattle', f.contributor_city)
|
45
|
+
assert_equal('WA', f.contributor_state)
|
46
|
+
assert_equal('981125032', f.contributor_zip)
|
47
|
+
assert_equal('P2002', f.item_election_code)
|
48
|
+
assert_equal('', f.item_election_other_description)
|
49
|
+
assert_equal('20020301', f.contribution_date)
|
50
|
+
assert_equal('200.00', f.contribution_amount)
|
51
|
+
assert_equal('300.00', f.contribution_aggregate)
|
52
|
+
assert_equal('', f.contribution_code)
|
53
|
+
assert_equal('', f.contribution_description)
|
54
|
+
assert_equal('TV & Ackerley Group', f.contributor_employer)
|
55
|
+
assert_equal('Media', f.contributor_occupation)
|
56
|
+
break
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_v500
|
62
|
+
h = FECHell.new
|
63
|
+
|
64
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.00"])
|
65
|
+
|
66
|
+
h.process(@testfiles["5.00"]) do |line|
|
67
|
+
schedule = line[0]
|
68
|
+
values = line[1]
|
69
|
+
|
70
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
71
|
+
# "SA11A1","C00256131","IND","^Morongo Bank of Mission Indians^^","PO Box 366",,"Cabazon","CA","92230 ","P2004","",,"Native American Right Fund","1000.00","20030813","1000.00","",,"","","","","","","","","","","","","","","","Con 48440","","","",""
|
72
|
+
|
73
|
+
if schedule == "SA"
|
74
|
+
assert_equal('C00256131', f.committee_fecid)
|
75
|
+
assert_equal('IND', f.entity_type)
|
76
|
+
assert_equal('Morongo Bank of Mission Indians', f.contributor_first_name)
|
77
|
+
assert_equal('PO Box 366', f.contributor_street_1)
|
78
|
+
assert_equal('', f.contributor_street_2)
|
79
|
+
assert_equal('Cabazon', f.contributor_city)
|
80
|
+
assert_equal('CA', f.contributor_state)
|
81
|
+
assert_equal('92230 ', f.contributor_zip)
|
82
|
+
assert_equal('P2004', f.item_election_code)
|
83
|
+
assert_equal('', f.item_election_other_description)
|
84
|
+
assert_equal('20030813', f.contribution_date)
|
85
|
+
assert_equal('1000.00', f.contribution_amount)
|
86
|
+
assert_equal('1000.00', f.contribution_aggregate)
|
87
|
+
assert_equal('', f.contribution_code)
|
88
|
+
assert_equal('', f.contribution_description)
|
89
|
+
assert_equal('', f.contributor_employer)
|
90
|
+
assert_equal('Native American Right Fund', f.contributor_occupation)
|
91
|
+
break
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_v51
|
97
|
+
h = FECHell.new
|
98
|
+
|
99
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.1"])
|
100
|
+
|
101
|
+
h.process(@testfiles["5.1"]) do |line|
|
102
|
+
schedule = line[0]
|
103
|
+
values = line[1]
|
104
|
+
|
105
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
106
|
+
|
107
|
+
#"SA11ai","C00372102","IND","","PO Box 35","","Uwchland","PA","194800035","G2004","","AHB Global Services","Executive","1000","20040505","1000","","","","","","","","","","","","","","","","","","SA11ai-c2972","","","","","","Aberle","John","M.","",""
|
108
|
+
|
109
|
+
if schedule == "SA"
|
110
|
+
assert_equal('C00372102', f.committee_fecid)
|
111
|
+
assert_equal('IND', f.entity_type)
|
112
|
+
assert_equal('Aberle', f.contributor_last_name)
|
113
|
+
assert_equal('John', f.contributor_first_name)
|
114
|
+
assert_equal('PO Box 35', f.contributor_street_1)
|
115
|
+
assert_equal('', f.contributor_street_2)
|
116
|
+
assert_equal('Uwchland', f.contributor_city)
|
117
|
+
assert_equal('PA', f.contributor_state)
|
118
|
+
assert_equal('194800035', f.contributor_zip)
|
119
|
+
assert_equal('G2004', f.item_election_code)
|
120
|
+
assert_equal('', f.item_election_other_description)
|
121
|
+
assert_equal('20040505', f.contribution_date)
|
122
|
+
assert_equal('1000', f.contribution_amount)
|
123
|
+
assert_equal('1000', f.contribution_aggregate)
|
124
|
+
assert_equal('', f.contribution_code)
|
125
|
+
assert_equal('', f.contribution_description)
|
126
|
+
assert_equal('AHB Global Services', f.contributor_employer)
|
127
|
+
assert_equal('Executive', f.contributor_occupation)
|
128
|
+
break
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_v52
|
134
|
+
h = FECHell.new
|
135
|
+
|
136
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.2"])
|
137
|
+
|
138
|
+
h.process(@testfiles["5.2"]) do |line|
|
139
|
+
schedule = line[0]
|
140
|
+
values = line[1]
|
141
|
+
|
142
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
143
|
+
|
144
|
+
if schedule == "SA"
|
145
|
+
assert_equal('C00346114', f.committee_fecid)
|
146
|
+
assert_equal('ORG', f.entity_type)
|
147
|
+
assert_equal('Tuf Enterprises', f.contributor_organization_name)
|
148
|
+
assert_equal('1 21st St', f.contributor_street_1)
|
149
|
+
assert_equal('', f.contributor_street_2)
|
150
|
+
assert_equal('Pittsburgh', f.contributor_city)
|
151
|
+
assert_equal('PA', f.contributor_state)
|
152
|
+
assert_equal('152224435', f.contributor_zip)
|
153
|
+
assert_equal('P2006', f.item_election_code)
|
154
|
+
assert_equal('', f.item_election_other_description)
|
155
|
+
assert_equal('20050321', f.contribution_date)
|
156
|
+
assert_equal('1000.00', f.contribution_amount)
|
157
|
+
assert_equal('1000.00', f.contribution_aggregate)
|
158
|
+
assert_equal('15', f.contribution_code)
|
159
|
+
assert_equal('Receipt', f.contribution_description)
|
160
|
+
assert_equal('', f.contributor_employer)
|
161
|
+
assert_equal('', f.contributor_occupation)
|
162
|
+
break
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
|
168
|
+
def test_v53
|
169
|
+
h = FECHell.new
|
170
|
+
|
171
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["5.3"])
|
172
|
+
|
173
|
+
h.process(@testfiles["5.3"]) do |line|
|
174
|
+
schedule = line[0]
|
175
|
+
values = line[1]
|
176
|
+
|
177
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
178
|
+
|
179
|
+
if schedule == "SA"
|
180
|
+
|
181
|
+
assert_equal('C00336065', f.committee_fecid)
|
182
|
+
assert_equal('IND', f.entity_type)
|
183
|
+
assert_equal('Acker', f.contributor_last_name)
|
184
|
+
assert_equal('Stephen', f.contributor_first_name)
|
185
|
+
assert_equal('1653 E Mountain St', f.contributor_street_1)
|
186
|
+
assert_equal('', f.contributor_street_2)
|
187
|
+
assert_equal('Pasadena', f.contributor_city)
|
188
|
+
assert_equal('CA', f.contributor_state)
|
189
|
+
assert_equal('91104', f.contributor_zip)
|
190
|
+
assert_equal('P2006', f.item_election_code)
|
191
|
+
assert_equal('', f.item_election_other_description)
|
192
|
+
assert_equal('20060328', f.contribution_date)
|
193
|
+
assert_equal('1000.00', f.contribution_amount)
|
194
|
+
assert_equal('1000.00', f.contribution_aggregate)
|
195
|
+
assert_equal('15', f.contribution_code)
|
196
|
+
assert_equal('Receipt', f.contribution_description)
|
197
|
+
assert_equal('Acker, Kowalick & Whipple', f.contributor_employer)
|
198
|
+
assert_equal('Attorney', f.contributor_occupation)
|
199
|
+
break
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def test_v61
|
205
|
+
h = FECHell.new
|
206
|
+
|
207
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.1"])
|
208
|
+
|
209
|
+
h.process(@testfiles["6.1"]) do |line|
|
210
|
+
schedule = line[0]
|
211
|
+
values = line[1]
|
212
|
+
|
213
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
214
|
+
|
215
|
+
if schedule == "SA"
|
216
|
+
|
217
|
+
assert_equal('C00417501', f.committee_fecid)
|
218
|
+
assert_equal('IND', f.entity_type)
|
219
|
+
assert_equal('Aimen', f.contributor_last_name)
|
220
|
+
assert_equal('Philip', f.contributor_first_name)
|
221
|
+
assert_equal('113 Yale Court', f.contributor_street_1)
|
222
|
+
assert_equal('', f.contributor_street_2)
|
223
|
+
assert_equal('Glenview', f.contributor_city)
|
224
|
+
assert_equal('IL', f.contributor_state)
|
225
|
+
assert_equal('600265916', f.contributor_zip)
|
226
|
+
assert_equal('G2008', f.item_election_code)
|
227
|
+
assert_equal('', f.item_election_other_description)
|
228
|
+
assert_equal('20080215', f.contribution_date)
|
229
|
+
assert_equal('100.00', f.contribution_amount)
|
230
|
+
assert_equal('400.00', f.contribution_aggregate)
|
231
|
+
assert_equal('', f.contribution_code)
|
232
|
+
assert_equal('', f.contribution_description)
|
233
|
+
assert_equal('Retired Attorney', f.contributor_employer)
|
234
|
+
assert_equal('Retired Attorney', f.contributor_occupation)
|
235
|
+
break
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
def test_v62
|
241
|
+
h = FECHell.new
|
242
|
+
|
243
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.2"])
|
244
|
+
|
245
|
+
h.process(@testfiles["6.2"]) do |line|
|
246
|
+
schedule = line[0]
|
247
|
+
values = line[1]
|
248
|
+
|
249
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
250
|
+
|
251
|
+
if schedule == "SA"
|
252
|
+
assert_equal('C00435974', f.committee_fecid)
|
253
|
+
assert_equal('IND', f.entity_type)
|
254
|
+
assert_equal('Aiken', f.contributor_last_name)
|
255
|
+
assert_equal('Timothy', f.contributor_first_name)
|
256
|
+
assert_equal('3217 Brookwood Road', f.contributor_street_1)
|
257
|
+
assert_equal('', f.contributor_street_2)
|
258
|
+
assert_equal('Birmingham', f.contributor_city)
|
259
|
+
assert_equal('AL', f.contributor_state)
|
260
|
+
assert_equal('35223', f.contributor_zip)
|
261
|
+
assert_equal('G2008', f.item_election_code)
|
262
|
+
assert_equal('', f.item_election_other_description)
|
263
|
+
assert_equal('20080602', f.contribution_date)
|
264
|
+
assert_equal('250.00', f.contribution_amount)
|
265
|
+
assert_equal('350.00', f.contribution_aggregate)
|
266
|
+
assert_equal('15', f.contribution_code)
|
267
|
+
assert_equal('', f.contribution_description)
|
268
|
+
assert_equal('Anesthesiologists Associated', f.contributor_employer)
|
269
|
+
assert_equal('Anesthesiologist', f.contributor_occupation)
|
270
|
+
break
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
def test_v63
|
276
|
+
h = FECHell.new
|
277
|
+
|
278
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.3"])
|
279
|
+
|
280
|
+
h.process(@testfiles["6.3"]) do |line|
|
281
|
+
schedule = line[0]
|
282
|
+
values = line[1]
|
283
|
+
|
284
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
285
|
+
if schedule == "SA"
|
286
|
+
assert_equal('C00458190', f.committee_fecid)
|
287
|
+
assert_equal('IND', f.entity_type)
|
288
|
+
assert_equal('Huddle', f.contributor_last_name)
|
289
|
+
assert_equal('Mark', f.contributor_first_name)
|
290
|
+
assert_equal('523 W Surf St Apt 3', f.contributor_street_1)
|
291
|
+
assert_equal('', f.contributor_street_2)
|
292
|
+
assert_equal('Chicago', f.contributor_city)
|
293
|
+
assert_equal('IL', f.contributor_state)
|
294
|
+
assert_equal('60657', f.contributor_zip)
|
295
|
+
assert_equal('O2009', f.item_election_code)
|
296
|
+
assert_equal('Special Primary', f.item_election_other_description)
|
297
|
+
assert_equal('20090226', f.contribution_date)
|
298
|
+
assert_equal('100.00', f.contribution_amount)
|
299
|
+
assert_equal('700.00', f.contribution_aggregate)
|
300
|
+
assert_equal('', f.contribution_code)
|
301
|
+
assert_equal('', f.contribution_description)
|
302
|
+
assert_equal('Wildman Harrold Allen & Dixon', f.contributor_employer)
|
303
|
+
assert_equal('Attorney', f.contributor_occupation)
|
304
|
+
break
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
def test_v64
|
310
|
+
h = FECHell.new
|
311
|
+
|
312
|
+
fec_version,original_form_type, form_type, values = h.header_lines(@testfiles["6.4"])
|
313
|
+
|
314
|
+
h.process(@testfiles["6.4"]) do |line|
|
315
|
+
schedule = line[0]
|
316
|
+
values = line[1]
|
317
|
+
|
318
|
+
f = FECForm.schedule_for(schedule, fec_version, values)
|
319
|
+
if schedule == "SA"
|
320
|
+
|
321
|
+
assert_equal('C00128868', f.committee_fecid)
|
322
|
+
assert_equal('IND', f.entity_type)
|
323
|
+
assert_equal('Abromowitz', f.contributor_last_name)
|
324
|
+
assert_equal('David', f.contributor_first_name)
|
325
|
+
assert_equal('66 Clyde St', f.contributor_street_1)
|
326
|
+
assert_equal('', f.contributor_street_2)
|
327
|
+
assert_equal('Newtonville', f.contributor_city)
|
328
|
+
assert_equal('MA', f.contributor_state)
|
329
|
+
assert_equal('024602250', f.contributor_zip)
|
330
|
+
assert_equal('P2010', f.item_election_code)
|
331
|
+
assert_equal('', f.item_election_other_description)
|
332
|
+
assert_equal('20090618', f.contribution_date)
|
333
|
+
assert_equal('500.00', f.contribution_amount)
|
334
|
+
assert_equal('500.00', f.contribution_aggregate)
|
335
|
+
assert_equal('', f.contribution_code)
|
336
|
+
assert_equal('', f.contribution_description)
|
337
|
+
assert_equal('Goulston & Storrs', f.contributor_employer)
|
338
|
+
assert_equal('Attorney', f.contributor_occupation)
|
339
|
+
break
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
end
|
345
|
+
|
346
|
+
Test::Unit::UI::Console::TestRunner.run(TC_FECTestScheduleA)
|