def test_address_closest_store(mocked, street, city, region, zip): address = Address(street, city, region, zip) assert_that( address, has_properties(line1='700 Pennsylvania Avenue NW', line2='Washington, DC, 20408')) store = address.closest_store() assert_that( store, has_properties( id='4336', data=has_entries( AddressDescription='1300 L St Nw\nWashington, DC 20005', AllowCarryoutOrders=True, AllowDeliveryOrders=True, HolidaysDescription='', HoursDescription='Su-Th 10:00am-1:00am\nFr-Sa 10:00am-2:00am', IsDeliveryStore=True, IsNEONow=False, IsOnlineCapable=True, IsOnlineNow=True, IsOpen=True, IsSpanish=False, LanguageLocationInfo=has_entries(es=None), LocationInfo=None, MaxDistance=0.8, MinDistance=0.8, Phone='202-639-8700', ServiceHoursDescription=has_entries( Carryout='Su-Sa 10:00am-10:00pm', Delivery='Su-Th 10:00am-1:00am\nFr-Sa 10:00am-2:00am'), ServiceIsOpen=has_entries(Carryout=True, Delivery=True), StoreID='4336')))
def test_address_nearby_stores(mocked, street, city, region, zip): address = Address(street, city, region, zip) assert_that( address, has_properties(line1='700 Pennsylvania Avenue NW', line2='Washington, DC, 20408')) stores = address.nearby_stores() assert_that(stores, has_length(12)) assert_that([x.data for x in stores], equal_to(stores_fixture['Stores']))
def __init__(self): self.name = "" self.address = Address("", "", "", "", "", "us") self.phone = "" self.place = "" self.card = "" self.items = [] self.total_price = 0
def test_address_init(street, city, region, zip): address = Address(street, city, region, zip) assert_that( address, has_properties(street='700 Pennsylvania Avenue NW', city='Washington', region='DC', zip='20408', line1='700 Pennsylvania Avenue NW', line2='Washington, DC, 20408', data=has_entries(Street='700 Pennsylvania Avenue NW', City='Washington', Region='DC', PostalCode='20408')))