-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests with syrupy and fixture (#466)
* Add syrupy package to Poetry * Add fixture and update the tests for syrupy * Update packages * Update garages and disabled parkings fixtures + tests * Revert the downgrade of ruff
- Loading branch information
1 parent
e85cfe1
commit c02596c
Showing
12 changed files
with
733 additions
and
869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# serializer version: 1 | ||
# name: test_all_garages | ||
list([ | ||
Garage(name='Parking Natalis', capacity=16, charging_stations=0, address='rue Natalis 49, 4020', municipality='Liège', city='Liège', provider='Bepark', schedule='sur abonnement ou réservation 24h / 7j', url='https://www.bepark.eu/fr/parking/wallonie/liege', longitude=5.5826088906, latitude=50.6301695672, created_at=datetime.datetime(2024, 3, 5, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 3, 5, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Saint-Denis', capacity=748, charging_stations=0, address='rue Lambert Lombard 5, 4000', municipality='Liège', city='Liège', provider='Saint-Denis', schedule='24h/24, 7j/7.', url='http://parkingstdenisliege.be', longitude=5.574644137, latitude=50.6435348112, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 4, 5, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Aquarium', capacity=70, charging_stations=0, address='rue Méan 26, 4020', municipality='Liège', city='Liège', provider='illico-park', schedule='24h/24, 7j/7.', url='http://www.illico-park.be', longitude=5.5800306678, latitude=50.6376851177, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 3, 28, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Saint-Lambert', capacity=500, charging_stations=0, address='place Saint-Lambert 41, 4000', municipality='Liège', city='Liège', provider='mypark', schedule='7j/7 - 24h/24', url='http://www.mypark.be', longitude=5.5727508764, latitude=50.6445693701, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 4, 4, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Carré-Jonfosse', capacity=156, charging_stations=2, address='rue Jonfosse 62, 4000', municipality='Liège', city='Liège', provider='mypark', schedule='24h/24, 7j/7.', url='http://www.mypark.be', longitude=5.5630714447, latitude=50.6401206676, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 4, 4, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Sauvenière', capacity=364, charging_stations=0, address='boulevard de la Sauvenière 102, 4000', municipality='Liège', city='Liège', provider='Indigo', schedule='24h/24 - 7j/7', url='https://www.indigoneo.be/fr/parkings/26716/parking-neujean', longitude=5.5653716221, latitude=50.6428485702, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 3, 28, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Saint-Paul', capacity=400, charging_stations=0, address='place Saint-Paul 3, 4000', municipality='Liège', city='Liège', provider='Saint-Paul', schedule='24h/24, 7j/7.', url='http://www.parkingstpaul.be', longitude=5.5713436408, latitude=50.6395769799, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 3, 29, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Kennedy', capacity=66, charging_stations=0, address='rue André Dumont None, 4000', municipality='Liège', city='Liège', provider='UHODA', schedule='24h/24, 7j/7.', url='https://uhoda.com/', longitude=5.5754324031, latitude=50.6382306915, created_at=datetime.datetime(2020, 9, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 3, 28, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Parking Sauvenière', capacity=18, charging_stations=0, address='boulevard de la Sauvenière 100, 4000', municipality='Liège', city='Liège', provider='Bepark', schedule='24h / 7j', url='https://www.bepark.eu/fr/parking/wallonie/liege', longitude=5.5654035149, latitude=50.6429408518, created_at=datetime.datetime(2022, 3, 17, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 3, 5, 0, 0, tzinfo=datetime.timezone.utc)), | ||
Garage(name='Central Park', capacity=167, charging_stations=4, address='boulevard de la Sauvenière 37, 4000', municipality='Liège', city='Liège', provider='Central Park', schedule='Du lundi au mercredi de 8h00 à 1h00 / en continu du jeudi au lundi de 8h à 1h00.', url='https://parkingcentral-park.be/', longitude=5.5676012903, latitude=50.6436758876, created_at=datetime.datetime(2024, 3, 28, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2024, 4, 8, 0, 0, tzinfo=datetime.timezone.utc)), | ||
]) | ||
# --- | ||
# name: test_disabled_parkings | ||
list([ | ||
DisabledParking(spot_id='cba258ed55c9c207f5bd4b9db97053be72f99eb7', number=1, address='quai Saint-Paul de Sinçay 103, 4031', municipality='Liège', city='Liège', status='Existant', longitude=5.6051201, latitude=50.602958578, created_at=datetime.datetime(2021, 11, 26, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 11, 26, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='f532805125b393e03e1feffb45c5695a9370a4b3', number=1, address='rue des Vennes 112, 4020', municipality='Liège', city='Liège', status='Existant', longitude=5.584375254, latitude=50.6273122047, created_at=datetime.datetime(2021, 3, 31, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2022, 2, 7, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='a5c82752dd23cfc9ecb1db2db496f964a59a3b82', number=1, address='avenue Freddy Terwagne 3, 4030', municipality='Liège', city='Liège', status='Existant', longitude=5.6285546432, latitude=50.6302120608, created_at=datetime.datetime(2021, 3, 27, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 3, 27, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='af10b2a70ad90340e5ade2ff9bef10e2344a94c6', number=1, address='avenue Freddy Terwagne 6, 4030', municipality='Liège', city='Liège', status='Existant', longitude=5.6296538896, latitude=50.6295297953, created_at=datetime.datetime(2021, 3, 26, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 3, 26, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='a48ff4080ce9bf776c64347026e979980b7aa708', number=1, address='avenue Rogier 18, 4000', municipality='Liège', city='Liège', status='Existant', longitude=5.5696178047, latitude=50.6318805217, created_at=datetime.datetime(2021, 3, 27, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 3, 27, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='90c7723fdd27a793bae73e9bac313d3877d646d4', number=1, address='Montagne Sainte-Walburge 43, 4000', municipality='Liège', city='Liège', status='Existant', longitude=5.5677519905, latitude=50.6487827409, created_at=datetime.datetime(2021, 3, 26, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 3, 26, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='e45cecc773093bb0196de7a0d109d2ae1609503a', number=1, address='place des Abeilles 6, 4020', municipality='Liège', city='Liège', status='Existant', longitude=5.6330619893, latitude=50.6434944053, created_at=datetime.datetime(2021, 3, 25, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 3, 25, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='0603bc39c5b386319c3b87da26f7bd2ee224ae37', number=1, address='avenue Joseph Merlot 152, 4020', municipality='Liège', city='Liège', status='Existant', longitude=5.6046285271, latitude=50.6371022363, created_at=datetime.datetime(2022, 4, 28, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2022, 8, 19, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='dcf2ee7c7db2189fd6b62ee529c686a87c9e9351', number=1, address='quai de Rome 6, 4000', municipality='Liège', city='Liège', status='Existant', longitude=5.5734664, latitude=50.6268205322, created_at=datetime.datetime(2021, 3, 27, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2022, 9, 2, 0, 0, tzinfo=datetime.timezone.utc)), | ||
DisabledParking(spot_id='672c079710eff02d9b4b08fba7057825ed643d20', number=1, address='quai Paul Van Hoegaerden 2, 4000', municipality='Liège', city='Liège', status='Existant', longitude=5.5759121688, latitude=50.6386193622, created_at=datetime.datetime(2013, 5, 30, 0, 0, tzinfo=datetime.timezone.utc), updated_at=datetime.datetime(2021, 9, 2, 0, 0, tzinfo=datetime.timezone.utc)), | ||
]) | ||
# --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Fixtures for the Liege ODP tests.""" | ||
|
||
from collections.abc import AsyncGenerator | ||
|
||
import pytest | ||
from aiohttp import ClientSession | ||
|
||
from liege import ODPLiege | ||
|
||
|
||
@pytest.fixture(name="odp_liege_client") | ||
async def client() -> AsyncGenerator[ODPLiege, None]: | ||
"""Fixture to create an ODPLiege client.""" | ||
async with ( | ||
ClientSession() as session, | ||
ODPLiege(session=session) as odp_liege_client, | ||
): | ||
yield odp_liege_client |
Oops, something went wrong.