Ejemplo n.º 1
0
    def test_it_finds_stores_by_name(self):
        stores_collection = decathlon_stores.DecathlonStores()

        result = stores_collection.find_by_name('Durango')

        assert len(result) == 1
        assert result[0].name == 'Durango'
Ejemplo n.º 2
0
    def test_it_finds_stores_by_distance_from_a_geo_position(self):
        stores_collection = decathlon_stores.DecathlonStores()

        result = stores_collection.find_by_distance(position=GeoPosition(
            39.5, 2.8),
                                                    radius_in_kilometers=100)

        assert all('Mallorca' in store.city for store in result)
Ejemplo n.º 3
0
    def test_it_finds_stores_by_part_of_the_zip_code_name(self):
        stores_collection = decathlon_stores.DecathlonStores()

        result = stores_collection.find_by_zip_code('482')

        assert any(store.zip_code == '48200' for store in result)
Ejemplo n.º 4
0
    def test_it_finds_stores_by_zip_code(self):
        stores_collection = decathlon_stores.DecathlonStores()

        result = stores_collection.find_by_zip_code('48200')

        assert all(store.zip_code == '48200' for store in result)
Ejemplo n.º 5
0
    def test_it_finds_stores_by_part_of_the_city_name(self):
        stores_collection = decathlon_stores.DecathlonStores()

        result = stores_collection.find_by_city('Mad')

        assert any(store.city == 'Madrid' for store in result)
Ejemplo n.º 6
0
    def test_it_finds_stores_by_part_of_the_name(self):
        stores_collection = decathlon_stores.DecathlonStores()

        result = stores_collection.find_by_name('Duran')

        assert any(store.name == 'Durango' for store in result)
Ejemplo n.º 7
0
 def test_it_decodes_all_stores(self):
     decathlon_stores.DecathlonStores()