4 from Errors
import RecordError
8 class OriginDestinationRecordParserTest(unittest
.TestCase
):
11 self
.odrp
= LEHD
.OriginDestinationRecordParser()
14 def testAllOfSubsetParsed(self
):
15 fixture_path
= Tests
.Fixtures
.Path() + '/LEHD/ten_records.csv'
16 records
= self
.odrp
.parse_file(fixture_path
)
17 self
.assertEqual(len(records
), 10)
20 def testErrorOnMissingColumns(self
):
21 fixture_path
= Tests
.Fixtures
.Path() + '/LEHD/ten_records-twelve_columns.csv'
22 self
.assertRaises(RecordError
, self
.odrp
.parse_file
, fixture_path
)
25 def testErrorOnMissingHeader(self
):
26 fixture_path
= Tests
.Fixtures
.Path() + '/LEHD/ten_records-no_header.csv'
27 self
.assertRaises(RecordError
, self
.odrp
.parse_file
, fixture_path
)
30 suite
= unittest
.TestSuite()
31 suite
.addTest(unittest
.makeSuite(OriginDestinationRecordParserTest
))