def test_fill_city_parking_no_special_events(self): city_parking_service = CityParkingService() parking_avails = [{'name': 'State Street Campus Garage', 'openSpots': 5}] city_parking_service.fill_cityparking_data_obj(parking_avails) with self.assertRaises(KeyError): spec = city_parking_service.parking_data['lots'][0]['specialEvents'] self.assertEquals(city_parking_service.parking_data['lots'][0]['openSpots'], 5)
def test_fill_city_parking_no_special_events(self): city_parking_service = CityParkingService() parking_avails = [{ 'name': 'State Street Campus Garage', 'openSpots': 5 }] city_parking_service.fill_cityparking_data_obj(parking_avails) with self.assertRaises(KeyError): spec = city_parking_service.parking_data['lots'][0][ 'specialEvents'] self.assertEquals( city_parking_service.parking_data['lots'][0]['openSpots'], 5)
def test_fill_city_parking_with_special_events(self): city_parking_service = CityParkingService() parking_avails = [{'name': 'State Street Campus Garage', 'openSpots': '5'}] spec_events = {'specialEvents': [{'parkingLocation': 'State Street Campus Garage', 'eventVenue': 'blah', 'eventDatetime': None, 'eventName': None, 'parkingStartDatetime': None, 'parkingEndDatetime': None, 'webUrl': 'http://'}]} city_parking_service.fill_cityparking_data_obj(parking_avails, spec_events) self.assertEquals(city_parking_service.parking_data['lots'][0]['openSpots'], '5') self.assertEquals(city_parking_service.parking_data['lots'][0]['specialEvents'][0]['eventVenue'], 'blah')
def test_fill_city_parking_with_special_events(self): city_parking_service = CityParkingService() parking_avails = [{ 'name': 'State Street Campus Garage', 'openSpots': '5' }] spec_events = { 'specialEvents': [{ 'parkingLocation': 'State Street Campus Garage', 'eventVenue': 'blah', 'eventDatetime': None, 'eventName': None, 'parkingStartDatetime': None, 'parkingEndDatetime': None, 'webUrl': 'http://' }] } city_parking_service.fill_cityparking_data_obj(parking_avails, spec_events) self.assertEquals( city_parking_service.parking_data['lots'][0]['openSpots'], '5') self.assertEquals( city_parking_service.parking_data['lots'][0]['specialEvents'][0] ['eventVenue'], 'blah')