def test_parse_pair_without_public_time_fails(self): data = { 'tiploc': 'SOTON', 'description': 'Southampton Central', 'workingTime': '125100', } with self.assertRaises(ValueError): parser.parse_pair(data)
def test_parse_pair_without_description_fails(self): data = { 'tiploc': 'SOTON', 'workingTime': '125100', 'publicTime': '1251' } with self.assertRaises(ValueError): parser.parse_pair(data)
def test_parse_pair(self): data = { 'tiploc': 'SOTON', 'description': 'Southampton Central', 'workingTime': '125100', 'publicTime': '1251' } actual = parser.parse_pair(data) self.assertEqual('SOTON', actual.tiploc) self.assertEqual('Southampton Central', actual.description) self.assertEqual('125100', actual.working_time) self.assertEqual('1251', actual.public_time)
def test_parse_location_detail_without_tiploc_fails(self): data = {'name': 'Southampton Central', 'crs': 'SOU'} with self.assertRaises(ValueError): parser.parse_pair(data)
def test_parse_location_detail_without_name_fails(self): data = {'crs': 'SOU', 'tiploc': 'SOTON'} with self.assertRaises(ValueError): parser.parse_pair(data)