X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTests%2FUnit%2FSummaryFile1Test.py;h=ca187b5c4aa3207f3811b013cf37642579cbc1b0;hb=d1ab5e381a646ad6e2c8ddee581980ca9ae0b18c;hp=18825dde9c10d3ced05cade2364173948c70d0b2;hpb=e29f3e5cc471e3cb60f641fcf3a3577c87896f36;p=dead%2Fcensus-tools.git diff --git a/src/Tests/Unit/SummaryFile1Test.py b/src/Tests/Unit/SummaryFile1Test.py index 18825dd..ca187b5 100644 --- a/src/Tests/Unit/SummaryFile1Test.py +++ b/src/Tests/Unit/SummaryFile1Test.py @@ -85,50 +85,11 @@ class GeoRecordParserTest(unittest.TestCase): fixture_path = Tests.Fixtures.Path() + '/SummaryFile1/mdgeo.uf1' blocks = self.grp.parse_blocks(fixture_path) self.assertEqual(len(blocks), 79128) - - -class SummaryFile1Test(unittest.TestCase): - - def testEachBlockIsClosestToItself(self): - blocks_path = Tests.Fixtures.Path() + '/SummaryFile1/mdgeo.uf1' - grp = SummaryFile1.GeoRecordParser() - blocks = grp.parse_blocks(blocks_path) - - # Only test 100 of these guys (or however many blocks there - # are in those 100 records. - fixtures_path = Tests.Fixtures.Path() + '/SummaryFile1/one_hundred_records.txt' - fixtures = grp.parse_blocks(fixtures_path) - - for b in fixtures: - # It's probably unnecessary to copy the coordinates - # into a new instance here, but whatever. - b_coords = GPS.Coordinates() - b_coords.latitude = b.coordinates.latitude - b_coords.longitude = b.coordinates.longitude - - closest_block = SummaryFile1.FindClosestBlock(blocks, b_coords) - self.assertEqual(b.block, closest_block.block) - - - def testEachBlockHasItsOwnAverageDensity(self): - geo_file_path = Tests.Fixtures.Path() + '/SummaryFile1/mdgeo.uf1' - - # Only test 5 of these guys; they take longer. - grp = SummaryFile1.GeoRecordParser() - fixtures_path = Tests.Fixtures.Path() + '/SummaryFile1/five_blocks.txt' - fixtures = grp.parse_blocks(fixtures_path) - - for b in fixtures: - # It's probably unnecessary to copy the coordinates - # into a new instance here, but whatever. - avg_density = SummaryFile1.FindAveragePopulationDensity(b.coordinates, geo_file_path) - self.assertEqual(b.population_density(), avg_density) - + def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(GeoRecordParserTest)) - suite.addTest(unittest.makeSuite(SummaryFile1Test)) suite.addTest(unittest.makeSuite(BlockTest)) return suite