def runTest(self): problems = UnrecognizedColumnRecorder(self) loader = transitfeed.Loader(util.DataPath('unrecognized_columns'), problems=problems) loader.Load() found_errors = set(problems.column_errors) expected_errors = set([('agency.txt', 'agency_lange'), ('stops.txt', 'stop_uri'), ('routes.txt', 'Route_Text_Color'), ('calendar.txt', 'leap_day'), ('calendar_dates.txt', 'leap_day'), ('trips.txt', 'sharpe_id'), ('stop_times.txt', 'shapedisttraveled'), ('stop_times.txt', 'drop_off_time'), ('fare_attributes.txt', 'transfer_time'), ('fare_rules.txt', 'source_id'), ('frequencies.txt', 'superfluous'), ('transfers.txt', 'to_stop')]) # Now make sure we got the unrecognized column errors that we expected. not_expected = found_errors.difference(expected_errors) self.failIf(not_expected, 'unexpected errors: %s' % str(not_expected)) not_found = expected_errors.difference(found_errors) self.failIf(not_found, 'expected but not found: %s' % str(not_found))
def runTest(self): loader = transitfeed.Loader( util.DataPath('utf8bom'), problems=util.GetTestFailureProblemReporter(self), extra_validation=True) loader.Load()