Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgesmr committed Feb 21, 2020
1 parent 7aef363 commit ae6d5ef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test-data/1385191.fec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HDRFEC8.3NGP8
F3PNC00693234Warren for President, Inc.124 Washington StreetSuite 101FoxboroMA02035XXM22020010120200131EgermanPaul2020022013715309.0611030669.0624745978.1222445998.022299980.100.00400000.000.0081024695.4689430381.800.005191564.005215093.1810406657.180.0015.000.0010406672.180.00400000.000.00400000.00220374.600.000.00220374.603622.2811030669.0622322012.600.000.000.000.000.000.00111018.940.0033.00111051.9412933.4822445998.020.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.0033014241.8848480591.5281494833.400.001436.005777.5081502046.9010415000.00400000.000.00400000.00559938.060.000.00559938.06151109.8893028094.8489990319.860.000.000.000.000.000.00477315.440.0036.00477351.44260443.4490728114.740.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00
SC/12C006932346071527L19AORGAmalgamated Bank275 7Th AveNew YorkNY100016708P2020400000.000.00400000.0020200121202107010.0600YN
SC2/12C006932346071527G6071527LWarrenElizabeth124 Washington StSte 101FoxboroMA020351368U.S. GovernmentSenator400000.00
SC1/12C006932346071527BL6071527LAmalgamated Bank275 7 Seventh AvenueNew YorkNY100013000000.000.06002020012120210701N400000.00400000.00YYCurrent and Future Assets3000000.00YYContributions Receivable3000000.0020190102Amalgamated Bank275 Seventh AvenueNew YorkNY10001EgermanPaul20200220PetersonWilliamSr Vice President20200220
20 changes: 20 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ def test_request(self):
sched_c = parsed['itemizations']['Schedule C'][0]
self.assertEqual(sched_c['loan_balance'], 30000.00)

class HandleScheduleCDates(unittest.TestCase):
def test_request(self):

file_path = 'test-data/1385191.fec'
a_filter = {'filter_itemizations': ['SB']}
parsed = fecfile.from_file(file_path)

sched_c_1 = parsed['itemizations']['Schedule C'][0]
self.assertIsInstance(sched_c_1['loan_incurred_date_terms'], datetime)
self.assertIsInstance(sched_c_1['loan_due_date_terms'], datetime)

sched_c_3 = parsed['itemizations']['Schedule C'][2]
self.assertIsInstance(sched_c_3['loan_incurred_date'], datetime)
self.assertIsInstance(sched_c_3['loan_due_date'], datetime)
self.assertIsInstance(sched_c_3['established_date'], datetime)
self.assertIsInstance(sched_c_3['date_signed'], datetime)
self.assertIsInstance(sched_c_3['authorized_date'], datetime)
self.assertIsNone(sched_c_3['loan_inccured_date_original'])
self.assertIsNone(sched_c_3['deposit_acct_auth_date_presidential'])

class HasScheduleD(unittest.TestCase):
def test_request(self):
Expand Down Expand Up @@ -396,6 +415,7 @@ def test_request(self):
TextLastRow('test_request'),
IndependentExpendituresReport('test_request'),
HasScheduleC('test_request'),
HandleScheduleCDates('test_request'),
HasScheduleD('test_request'),
HasScheduleI('test_request'),
HandleF1FromWebForms('test_request'),
Expand Down

0 comments on commit ae6d5ef

Please sign in to comment.