diff --git a/README.md b/README.md index 5b0fb52..d29e6d4 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ pip install liege You can read the following datasets with this package: -- [Disabled parking spaces / Stationnement PMR][disabled_parking] (952 locations) -- [Garages / Les parkings voitures hors voirie][garages] (26 locations) +- [Disabled parking spaces / Stationnement PMR][disabled_parking] (1062 locations) +- [Garages / Les parkings voitures hors voirie][garages] (32 locations)
Click here to get more details @@ -174,6 +174,12 @@ To run just the Python tests: poetry run pytest ``` +To update the [syrupy](https://github.com/tophat/syrupy) snapshot tests: + +```bash +poetry run pytest --snapshot-update +``` + ## License MIT License diff --git a/examples/disabled_parkings.py b/examples/disabled_parkings.py index 6126a12..59e07e3 100644 --- a/examples/disabled_parkings.py +++ b/examples/disabled_parkings.py @@ -11,7 +11,7 @@ async def main() -> None: """Get the disabled parkings data from Liège API.""" async with ODPLiege() as client: - disabled_parkings = await client.disabled_parkings(limit=5) + disabled_parkings = await client.disabled_parkings(limit=10) count: int = len(disabled_parkings) for item in disabled_parkings: diff --git a/examples/garages.py b/examples/garages.py index 48d4a51..d702c41 100644 --- a/examples/garages.py +++ b/examples/garages.py @@ -9,7 +9,7 @@ async def main() -> None: """Get the garages data from Liège API.""" async with ODPLiege() as client: - garages = await client.garages(limit=12) + garages = await client.garages(limit=10) count: int = len(garages) for item in garages: diff --git a/poetry.lock b/poetry.lock index a50ed8d..ef2ed76 100644 --- a/poetry.lock +++ b/poetry.lock @@ -812,7 +812,6 @@ files = [ {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, @@ -820,16 +819,8 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, @@ -846,7 +837,6 @@ files = [ {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, @@ -854,7 +844,6 @@ files = [ {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, @@ -887,24 +876,24 @@ python-versions = ">=3.6" files = [ {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-macosx_13_0_arm64.whl", hash = "sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462"}, + {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:d92f81886165cb14d7b067ef37e142256f1c6a90a65cd156b063a43da1708cfd"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412"}, - {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_24_aarch64.whl", hash = "sha256:aa2267c6a303eb483de8d02db2871afb5c5fc15618d894300b88958f729ad74f"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:840f0c7f194986a63d2c2465ca63af8ccbbc90ab1c6001b1978f05119b5e7334"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:024cfe1fc7c7f4e1aff4a81e718109e13409767e4f871443cbff3dba3578203d"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win32.whl", hash = "sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d"}, {file = "ruamel.yaml.clib-0.2.8-cp310-cp310-win_amd64.whl", hash = "sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-macosx_13_0_arm64.whl", hash = "sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248"}, + {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:b5edda50e5e9e15e54a6a8a0070302b00c518a9d32accc2346ad6c984aacd279"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b"}, - {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-manylinux_2_24_aarch64.whl", hash = "sha256:1707814f0d9791df063f8c19bb51b0d1278b8e9a2353abbb676c2f685dee6afe"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:46d378daaac94f454b3a0e3d8d78cafd78a026b1d71443f4966c696b48a6d899"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:09b055c05697b38ecacb7ac50bdab2240bfca1a0c4872b0fd309bb07dc9aa3a9"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win32.whl", hash = "sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7"}, {file = "ruamel.yaml.clib-0.2.8-cp311-cp311-win_amd64.whl", hash = "sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-macosx_13_0_arm64.whl", hash = "sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2"}, + {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:7048c338b6c86627afb27faecf418768acb6331fc24cfa56c93e8c9780f815fa"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92"}, - {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-manylinux_2_24_aarch64.whl", hash = "sha256:1dc67314e7e1086c9fdf2680b7b6c2be1c0d8e3a8279f2e993ca2a7545fecf62"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3213ece08ea033eb159ac52ae052a4899b56ecc124bb80020d9bbceeb50258e9"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aab7fd643f71d7946f2ee58cc88c9b7bfc97debd71dcc93e03e2d174628e7e2d"}, {file = "ruamel.yaml.clib-0.2.8-cp312-cp312-win32.whl", hash = "sha256:5c365d91c88390c8d0a8545df0b5857172824b1c604e867161e6b3d59a827eaa"}, @@ -912,7 +901,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-macosx_12_0_arm64.whl", hash = "sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875"}, - {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_24_aarch64.whl", hash = "sha256:77159f5d5b5c14f7c34073862a6b7d34944075d9f93e681638f6d753606c6ce6"}, + {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:3fcc54cb0c8b811ff66082de1680b4b14cf8a81dce0d4fbf665c2265a81e07a1"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4ecbf9c3e19f9562c7fdd462e8d18dd902a47ca046a2e64dba80699f0b6c09b7"}, {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:87ea5ff66d8064301a154b3933ae406b0863402a799b16e4a1d24d9fbbcbe0d3"}, @@ -920,7 +909,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.8-cp37-cp37m-win_amd64.whl", hash = "sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337"}, - {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_24_aarch64.whl", hash = "sha256:305889baa4043a09e5b76f8e2a51d4ffba44259f6b4c72dec8ca56207d9c6fe1"}, + {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:665f58bfd29b167039f714c6998178d27ccd83984084c286110ef26b230f259f"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e2b4c44b60eadec492926a7270abb100ef9f72798e18743939bdbf037aab8c28"}, {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e79e5db08739731b0ce4850bed599235d601701d5694c36570a99a0c5ca41a9d"}, @@ -928,7 +917,7 @@ files = [ {file = "ruamel.yaml.clib-0.2.8-cp38-cp38-win_amd64.whl", hash = "sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf"}, - {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_24_aarch64.whl", hash = "sha256:a1a45e0bb052edf6a1d3a93baef85319733a888363938e1fc9924cb00c8df24c"}, + {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:9eb5dee2772b0f704ca2e45b1713e4e5198c18f515b52743576d196348f374d3"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:184565012b60405d93838167f425713180b949e9d8dd0bbc7b49f074407c5a8b"}, {file = "ruamel.yaml.clib-0.2.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a75879bacf2c987c003368cf14bed0ffe99e8e85acfa6c0bfffc21a090f16880"}, @@ -979,6 +968,20 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +[[package]] +name = "syrupy" +version = "4.6.1" +description = "Pytest Snapshot Test Utility" +optional = false +python-versions = ">=3.8.1,<4" +files = [ + {file = "syrupy-4.6.1-py3-none-any.whl", hash = "sha256:203e52f9cb9fa749cf683f29bd68f02c16c3bc7e7e5fe8f2fc59bdfe488ce133"}, + {file = "syrupy-4.6.1.tar.gz", hash = "sha256:37a835c9ce7857eeef86d62145885e10b3cb9615bc6abeb4ce404b3f18e1bb36"}, +] + +[package.dependencies] +pytest = ">=7.0.0,<9.0.0" + [[package]] name = "tomlkit" version = "0.12.4" @@ -1145,4 +1148,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "0381562ee848afa94a61c71048d69e11f0830819c17bc4d8fbb63914289164b5" +content-hash = "af577ef9d6c05b671ee56ebab6baac30586fd7fb3334187a2bac3b73a43eb500" diff --git a/pyproject.toml b/pyproject.toml index f4ee92c..8a937f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,7 @@ pytest = "8.1.1" pytest-asyncio = "0.23.6" pytest-cov = "5.0.0" ruff = "0.4.1" +syrupy = "4.6.1" yamllint = "1.35.1" [tool.coverage.run] diff --git a/src/liege/models.py b/src/liege/models.py index 1f5161e..42eb4c8 100644 --- a/src/liege/models.py +++ b/src/liege/models.py @@ -58,8 +58,12 @@ def from_dict(cls: type[Garage], data: dict[str, Any]) -> Garage: url=attr.get("website"), longitude=geo[0], latitude=geo[1], - created_at=strptime(attr.get("created"), "%Y-%m-%d"), - updated_at=strptime(attr.get("last_modified"), "%Y-%m-%d"), + created_at=datetime.strptime(attr.get("created"), "%Y-%m-%d").replace( + tzinfo=UTC + ), + updated_at=datetime.strptime(attr.get("last_modified"), "%Y-%m-%d").replace( + tzinfo=UTC + ), ) @@ -77,7 +81,7 @@ class DisabledParking: longitude: float latitude: float - created_at: datetime | None + created_at: datetime updated_at: datetime @classmethod @@ -108,31 +112,15 @@ def from_dict(cls: type[DisabledParking], data: dict[str, Any]) -> DisabledParki status=attr.get("status"), longitude=geo[0], latitude=geo[1], - created_at=strptime(attr.get("created"), "%Y-%m-%d"), - updated_at=strptime(attr.get("last_modified"), "%Y-%m-%d"), + created_at=datetime.strptime(attr.get("created"), "%Y-%m-%d").replace( + tzinfo=UTC + ), + updated_at=datetime.strptime(attr.get("last_modified"), "%Y-%m-%d").replace( + tzinfo=UTC + ), ) -def strptime(date_string: str, date_format: str, default: None = None) -> Any: - """Strptime function with default value. - - Args: - ---- - date_string: The date string. - date_format: The format of the date string. - default: The default value. - - Returns: - ------- - The datetime object. - - """ - try: - return datetime.strptime(date_string, date_format).replace(tzinfo=UTC) - except (ValueError, TypeError): - return default - - def set_address(street: str, number: str, postal_code: str) -> str: """Set the address. diff --git a/tests/__snapshots__/test_models.ambr b/tests/__snapshots__/test_models.ambr new file mode 100644 index 0000000..6410986 --- /dev/null +++ b/tests/__snapshots__/test_models.ambr @@ -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)), + ]) +# --- diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..a0b0506 --- /dev/null +++ b/tests/conftest.py @@ -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 diff --git a/tests/fixtures/disabled_parkings.json b/tests/fixtures/disabled_parkings.json index 16c947d..c42cb9f 100644 --- a/tests/fixtures/disabled_parkings.json +++ b/tests/fixtures/disabled_parkings.json @@ -1,391 +1,304 @@ { - "nhits": 950, - "parameters": { - "dataset": "stationnement-pmr", - "rows": 10, - "start": 0, - "format": "json", - "timezone": "UTC" + "nhits": 1062, + "parameters": { + "dataset": "stationnement-pmr", + "rows": 10, + "start": 0, + "format": "json", + "timezone": "UTC" + }, + "records": [ + { + "datasetid": "stationnement-pmr", + "recordid": "cba258ed55c9c207f5bd4b9db97053be72f99eb7", + "fields": { + "street_code": 7241, + "geo_point_2d": [50.602958578, 5.6051201], + "last_modified": "2021-11-26", + "available_spaces": 1, + "icar_street_id": 7730142, + "status": "Existant", + "gid": 1833, + "municipality": "Liège", + "street_name": "quai Saint-Paul de Sinçay", + "created": "2021-11-26", + "geo_shape": { + "coordinates": [5.6051201, 50.602958578], + "type": "Point" + }, + "house_number": "103", + "icar_address_id": 1108862, + "city": "Liège", + "postal_code": 4031 + }, + "geometry": { + "type": "Point", + "coordinates": [5.6051201, 50.602958578] + }, + "record_timestamp": "2024-04-18T22:31:00Z" }, - "records": [ - { - "datasetid": "stationnement-pmr", - "recordid": "cba258ed55c9c207f5bd4b9db97053be72f99eb7", - "fields": { - "street_code": 7241, - "geo_point_2d": [ - 50.602958578, - 5.6051201 - ], - "last_modified": "2021-11-26", - "available_spaces": 1, - "icar_street_id": 7730142, - "status": "Existant", - "gid": 1833, - "municipality": "Liège", - "street_name": "quai Saint-Paul de Sinçay", - "created": "2021-11-26", - "geo_shape": { - "coordinates": [ - 5.6051201, - 50.602958578 - ], - "type": "Point" - }, - "house_number": "103", - "icar_address_id": 1108862, - "city": "Liège", - "postal_code": 4031 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.6051201, - 50.602958578 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + { + "datasetid": "stationnement-pmr", + "recordid": "f532805125b393e03e1feffb45c5695a9370a4b3", + "fields": { + "street_code": 1258, + "geo_point_2d": [50.6273122047, 5.584375254], + "last_modified": "2022-02-07", + "available_spaces": 1, + "icar_street_id": 7730730, + "status": "Existant", + "gid": 1668, + "municipality": "Liège", + "street_name": "rue des Vennes", + "created": "2021-03-31", + "geo_shape": { + "coordinates": [5.584375254, 50.6273122047], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "f532805125b393e03e1feffb45c5695a9370a4b3", - "fields": { - "street_code": 1258, - "geo_point_2d": [ - 50.6273122047, - 5.584375254 - ], - "last_modified": "2022-02-07", - "available_spaces": 1, - "icar_street_id": 7730730, - "status": "Existant", - "gid": 1668, - "municipality": "Liège", - "street_name": "rue des Vennes", - "created": "2021-03-31", - "geo_shape": { - "coordinates": [ - 5.584375254, - 50.6273122047 - ], - "type": "Point" - }, - "house_number": "112", - "icar_address_id": 1241319, - "city": "Liège", - "postal_code": 4020 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.584375254, - 50.6273122047 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "112", + "icar_address_id": 1241319, + "city": "Liège", + "postal_code": 4020 + }, + "geometry": { + "type": "Point", + "coordinates": [5.584375254, 50.6273122047] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "a5c82752dd23cfc9ecb1db2db496f964a59a3b82", + "fields": { + "street_code": 7666, + "geo_point_2d": [50.6302120608, 5.6285546432], + "last_modified": "2021-03-27", + "available_spaces": 1, + "icar_street_id": 7729648, + "status": "Existant", + "gid": 1581, + "municipality": "Liège", + "street_name": "avenue Freddy Terwagne", + "created": "2021-03-27", + "geo_shape": { + "coordinates": [5.6285546432, 50.6302120608], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "a5c82752dd23cfc9ecb1db2db496f964a59a3b82", - "fields": { - "street_code": 7666, - "geo_point_2d": [ - 50.6302120608, - 5.6285546432 - ], - "last_modified": "2021-03-27", - "available_spaces": 1, - "icar_street_id": 7729648, - "status": "Existant", - "gid": 1581, - "municipality": "Liège", - "street_name": "avenue Freddy Terwagne", - "created": "2021-03-27", - "geo_shape": { - "coordinates": [ - 5.6285546432, - 50.6302120608 - ], - "type": "Point" - }, - "house_number": "3", - "icar_address_id": 1441771, - "city": "Liège", - "postal_code": 4030 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.6285546432, - 50.6302120608 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "3", + "icar_address_id": 1441771, + "city": "Liège", + "postal_code": 4030 + }, + "geometry": { + "type": "Point", + "coordinates": [5.6285546432, 50.6302120608] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "af10b2a70ad90340e5ade2ff9bef10e2344a94c6", + "fields": { + "street_code": 7666, + "geo_point_2d": [50.6295297953, 5.6296538896], + "last_modified": "2021-03-26", + "available_spaces": 1, + "icar_street_id": 7729648, + "status": "Existant", + "gid": 1408, + "municipality": "Liège", + "street_name": "avenue Freddy Terwagne", + "created": "2021-03-26", + "geo_shape": { + "coordinates": [5.6296538896, 50.6295297953], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "af10b2a70ad90340e5ade2ff9bef10e2344a94c6", - "fields": { - "street_code": 7666, - "geo_point_2d": [ - 50.6295297953, - 5.6296538896 - ], - "last_modified": "2021-03-26", - "available_spaces": 1, - "icar_street_id": 7729648, - "status": "Existant", - "gid": 1408, - "municipality": "Liège", - "street_name": "avenue Freddy Terwagne", - "created": "2021-03-26", - "geo_shape": { - "coordinates": [ - 5.6296538896, - 50.6295297953 - ], - "type": "Point" - }, - "house_number": "6", - "icar_address_id": 1107123, - "city": "Liège", - "postal_code": 4030 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.6296538896, - 50.6295297953 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "6", + "icar_address_id": 1107123, + "city": "Liège", + "postal_code": 4030 + }, + "geometry": { + "type": "Point", + "coordinates": [5.6296538896, 50.6295297953] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "a48ff4080ce9bf776c64347026e979980b7aa708", + "fields": { + "street_code": 365, + "geo_point_2d": [50.6318805217, 5.5696178047], + "last_modified": "2021-03-27", + "available_spaces": 1, + "icar_street_id": 7729664, + "status": "Existant", + "gid": 1543, + "municipality": "Liège", + "street_name": "avenue Rogier", + "created": "2021-03-27", + "geo_shape": { + "coordinates": [5.5696178047, 50.6318805217], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "a48ff4080ce9bf776c64347026e979980b7aa708", - "fields": { - "street_code": 365, - "geo_point_2d": [ - 50.6318805217, - 5.5696178047 - ], - "last_modified": "2021-03-27", - "available_spaces": 1, - "icar_street_id": 7729664, - "status": "Existant", - "gid": 1543, - "municipality": "Liège", - "street_name": "avenue Rogier", - "created": "2021-03-27", - "geo_shape": { - "coordinates": [ - 5.5696178047, - 50.6318805217 - ], - "type": "Point" - }, - "house_number": "18", - "icar_address_id": 1121257, - "city": "Liège", - "postal_code": 4000 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5696178047, - 50.6318805217 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "18", + "icar_address_id": 1121257, + "city": "Liège", + "postal_code": 4000 + }, + "geometry": { + "type": "Point", + "coordinates": [5.5696178047, 50.6318805217] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "90c7723fdd27a793bae73e9bac313d3877d646d4", + "fields": { + "street_code": 851, + "geo_point_2d": [50.6487827409, 5.5677519905], + "last_modified": "2021-03-26", + "available_spaces": 1, + "icar_street_id": 7729933, + "status": "Existant", + "gid": 1492, + "municipality": "Liège", + "street_name": "Montagne Sainte-Walburge", + "created": "2021-03-26", + "geo_shape": { + "coordinates": [5.5677519905, 50.6487827409], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "72afbf64b9a82b0413b25961e8f2544db756f124", - "fields": { - "street_code": 31, - "geo_point_2d": [ - 50.6307092203, - 5.5680728796 - ], - "last_modified": "2021-08-27", - "available_spaces": 1, - "icar_street_id": 7729672, - "status": "Existant", - "gid": 1798, - "municipality": "Liège", - "street_name": "boulevard d'Avroy", - "created": "2021-08-27", - "geo_shape": { - "coordinates": [ - 5.5680728796, - 50.6307092203 - ], - "type": "Point" - }, - "house_number": "276", - "icar_address_id": 1119508, - "city": "Liège", - "postal_code": 4000 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5680728796, - 50.6307092203 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "43", + "icar_address_id": 1105875, + "city": "Liège", + "postal_code": 4000 + }, + "geometry": { + "type": "Point", + "coordinates": [5.5677519905, 50.6487827409] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "e45cecc773093bb0196de7a0d109d2ae1609503a", + "fields": { + "street_code": 642, + "geo_point_2d": [50.6434944053, 5.6330619893], + "last_modified": "2021-03-25", + "available_spaces": 1, + "icar_street_id": 7729985, + "status": "Existant", + "gid": 1257, + "municipality": "Liège", + "street_name": "place des Abeilles", + "created": "2021-03-25", + "geo_shape": { + "coordinates": [5.6330619893, 50.6434944053], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "0f803ce3f8a439b97b87590ce1d9a7f041cb7823", - "fields": { - "street_code": 1214, - "geo_point_2d": [ - 50.6218024925, - 5.5943756709 - ], - "last_modified": "2021-03-25", - "available_spaces": 1, - "icar_street_id": 7729674, - "status": "Existant", - "gid": 1365, - "municipality": "Liège", - "street_name": "boulevard de Douai", - "created": "2021-03-25", - "geo_shape": { - "coordinates": [ - 5.5943756709, - 50.6218024925 - ], - "type": "Point" - }, - "house_number": "21", - "icar_address_id": 1121671, - "city": "Liège", - "postal_code": 4030 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5943756709, - 50.6218024925 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "6", + "icar_address_id": 1117086, + "city": "Liège", + "postal_code": 4020 + }, + "geometry": { + "type": "Point", + "coordinates": [5.6330619893, 50.6434944053] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "0603bc39c5b386319c3b87da26f7bd2ee224ae37", + "fields": { + "street_code": 6322, + "geo_point_2d": [50.6371022363, 5.6046285271], + "last_modified": "2022-08-19", + "available_spaces": 1, + "length": 6, + "icar_street_id": 7729655, + "status": "Existant", + "gid": 1847, + "municipality": "Liège", + "street_name": "avenue Joseph Merlot", + "created": "2022-04-28", + "geo_shape": { + "coordinates": [5.6046285271, 50.6371022363], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "0052b27ddde3d099a0711783f8544d302690d7d0", - "fields": { - "street_code": 8227, - "geo_point_2d": [ - 50.6670818366, - 5.5570811831 - ], - "last_modified": "2021-03-25", - "available_spaces": 1, - "icar_street_id": 7729709, - "status": "Existant", - "gid": 1322, - "municipality": "Liège", - "street_name": "chaussée de Tongres", - "created": "2021-03-25", - "geo_shape": { - "coordinates": [ - 5.5570811831, - 50.6670818366 - ], - "type": "Point" - }, - "house_number": "139", - "icar_address_id": 1130371, - "city": "Liège", - "postal_code": 4000 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5570811831, - 50.6670818366 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "152", + "icar_address_id": 1220330, + "city": "Liège", + "postal_code": 4020, + "commissioning_year": 2022 + }, + "geometry": { + "type": "Point", + "coordinates": [5.6046285271, 50.6371022363] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "dcf2ee7c7db2189fd6b62ee529c686a87c9e9351", + "fields": { + "street_code": 366, + "geo_point_2d": [50.6268205322, 5.5734664], + "last_modified": "2022-09-02", + "available_spaces": 1, + "icar_street_id": 7730118, + "status": "Existant", + "gid": 1544, + "municipality": "Liège", + "street_name": "quai de Rome", + "created": "2021-03-27", + "geo_shape": { + "coordinates": [5.5734664, 50.6268205322], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "90c7723fdd27a793bae73e9bac313d3877d646d4", - "fields": { - "street_code": 851, - "geo_point_2d": [ - 50.6487827409, - 5.5677519905 - ], - "last_modified": "2021-03-26", - "available_spaces": 1, - "icar_street_id": 7729933, - "status": "Existant", - "gid": 1492, - "municipality": "Liège", - "street_name": "Montagne Sainte-Walburge", - "created": "2021-03-26", - "geo_shape": { - "coordinates": [ - 5.5677519905, - 50.6487827409 - ], - "type": "Point" - }, - "house_number": "43", - "icar_address_id": 1105875, - "city": "Liège", - "postal_code": 4000 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5677519905, - 50.6487827409 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" + "house_number": "6", + "icar_address_id": 1108005, + "city": "Liège", + "postal_code": 4000 + }, + "geometry": { + "type": "Point", + "coordinates": [5.5734664, 50.6268205322] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + }, + { + "datasetid": "stationnement-pmr", + "recordid": "672c079710eff02d9b4b08fba7057825ed643d20", + "fields": { + "street_code": 249, + "geo_point_2d": [50.6386193622, 5.5759121688], + "last_modified": "2021-09-02", + "available_spaces": 1, + "icar_street_id": 7730138, + "status": "Existant", + "gid": 829, + "municipality": "Liège", + "street_name": "quai Paul Van Hoegaerden", + "created": "2013-05-30", + "geo_shape": { + "coordinates": [5.5759121688, 50.6386193622], + "type": "Point" }, - { - "datasetid": "stationnement-pmr", - "recordid": "e45cecc773093bb0196de7a0d109d2ae1609503a", - "fields": { - "street_code": 642, - "geo_point_2d": [ - 50.6434944053, - 5.6330619893 - ], - "last_modified": "2021-03-25", - "available_spaces": 1, - "icar_street_id": 7729985, - "status": "Existant", - "gid": 1257, - "municipality": "Liège", - "street_name": "place des Abeilles", - "geo_shape": { - "coordinates": [ - 5.6330619893, - 50.6434944053 - ], - "type": "Point" - }, - "house_number": "6", - "icar_address_id": 1117086, - "city": "Liège", - "postal_code": 4020 - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.6330619893, - 50.6434944053 - ] - }, - "record_timestamp": "2022-07-18T22:56:00Z" - } - ] + "house_number": "2", + "icar_address_id": 1117435, + "city": "Liège", + "postal_code": 4000 + }, + "geometry": { + "type": "Point", + "coordinates": [5.5759121688, 50.6386193622] + }, + "record_timestamp": "2024-04-18T22:31:00Z" + } + ] } diff --git a/tests/fixtures/garages.json b/tests/fixtures/garages.json index c53a864..0c8712e 100644 --- a/tests/fixtures/garages.json +++ b/tests/fixtures/garages.json @@ -1,416 +1,328 @@ { - "nhits": 26, - "parameters": { - "dataset": "parkings-voitures-hors-voirie", - "rows": 10, - "start": 0, - "format": "json", - "timezone": "UTC" + "nhits": 32, + "parameters": { + "dataset": "parkings-voitures-hors-voirie", + "rows": 10, + "start": 0, + "format": "json", + "timezone": "UTC" + }, + "records": [ + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "ee9d7c75b6af141a964e70da052cd63e3d928e5e", + "fields": { + "postal_code": 4020, + "geo_point_2d": [50.6301695672, 5.5826088906], + "gid": 181, + "street_name": "rue Natalis", + "last_modified": "2024-03-05", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5826088906, 50.6301695672], + "type": "Point" + }, + "title": "Parking Natalis", + "available_spaces": 16, + "created": "2024-03-05", + "schedule": "sur abonnement ou réservation 24h / 7j", + "email": "info-be@bepark.eu", + "house_number": "49", + "website": "https://www.bepark.eu/fr/parking/wallonie/liege", + "city": "Liège", + "municipality": "Liège", + "provider": "Bepark", + "phone_numbers": "02/8800550" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5826088906, 50.6301695672] + }, + "record_timestamp": "2024-04-18T22:29:00Z" }, - "records": [ - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "b2bf3883e8f12dd555cebd4863c02ece91c0bcd3", - "fields": { - "geo_point_2d": [ - 50.6429408518, - 5.5654035149 - ], - "title": "Parking Sauvenière", - "house_number": "100", - "available_spaces": 16, - "created": "2022-03-17", - "municipality": "Liège", - "postal_code": 4000, - "gid": 161, - "charging_stations": 0, - "street_name": "boulevard de la Sauvenière", - "phone_number": "+32(0)28800550", - "schedule": "24h / 7j", - "website": "https://www.bepark.eu/fr/parking/wallonie/liege", - "geo_shape": { - "coordinates": [ - 5.5654035149, - 50.6429408518 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2022-03-17", - "provider": "Be-Park", - "email": "info-be@bepark.eu" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5654035149, - 50.6429408518 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "f11deb292900fb93c073ad747dc0dcd8f8bc0d26", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6435348112, 5.574644137], + "gid": 21, + "street_name": "rue Lambert Lombard", + "last_modified": "2024-04-05", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.574644137, 50.6435348112], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "03e4a3ba2a30db624ce9f7fb4bb78e651fe29d3f", - "fields": { - "geo_point_2d": [ - 50.6435348112, - 5.574644137 - ], - "title": "Parking Saint-Denis", - "house_number": "5", - "available_spaces": 748, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4000, - "gid": 21, - "charging_stations": 0, - "street_name": "rue Lambert Lombard", - "phone_number": "+32 (0) 4 223 60 96", - "schedule": "24h/24, 7j/7.", - "website": "http://parkingstdenisliege.be", - "geo_shape": { - "coordinates": [ - 5.574644137, - 50.6435348112 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-06-11", - "provider": "Saint-Denis" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.574644137, - 50.6435348112 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Saint-Denis", + "available_spaces": 748, + "created": "2020-09-25", + "schedule": "24h/24, 7j/7.", + "house_number": "5", + "website": "http://parkingstdenisliege.be", + "city": "Liège", + "municipality": "Liège", + "provider": "Saint-Denis", + "phone_numbers": "+32 (0) 4 223 60 96" + }, + "geometry": { + "type": "Point", + "coordinates": [5.574644137, 50.6435348112] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "44b75a461c2030eaaa96e315130ab940cf17d12d", + "fields": { + "postal_code": 4020, + "geo_point_2d": [50.6376851177, 5.5800306678], + "gid": 1, + "street_name": "rue Méan", + "last_modified": "2024-03-28", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5800306678, 50.6376851177], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "675e733b2bb713ecfca818da2a09108a5fd19b73", - "fields": { - "geo_point_2d": [ - 50.6311729725, - 5.5674353803 - ], - "title": "Parking Rotterdam", - "house_number": "4", - "available_spaces": 147, - "created": "2021-08-16", - "municipality": "Liège", - "postal_code": 4000, - "gid": 141, - "street_name": "rue de Rotterdam", - "phone_number": "+32 (0) 2 880 05 50", - "schedule": "sur abonnement ou réservation : 24h/24, 7j/7.", - "website": "https://www.bepark.eu/fr/parking/belgique/liege/rue-de-rotterdam/1030", - "geo_shape": { - "coordinates": [ - 5.5674353803, - 50.6311729725 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-08-16", - "provider": "Bepark", - "email": "info-be@bepark.eu" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5674353803, - 50.6311729725 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Aquarium", + "available_spaces": 70, + "created": "2020-09-25", + "schedule": "24h/24, 7j/7.", + "email": "info@illico-park.be", + "house_number": "26", + "website": "http://www.illico-park.be", + "city": "Liège", + "municipality": "Liège", + "provider": "illico-park", + "phone_numbers": "+32 (0) 473 433 835" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5800306678, 50.6376851177] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "9aeaf650ae2131ed06a4d24460634ed597491c9c", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6445693701, 5.5727508764], + "gid": 23, + "street_name": "place Saint-Lambert", + "last_modified": "2024-04-04", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5727508764, 50.6445693701], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "ca5840303443d4796d6fcec8f5aaf6aeb9515c9f", - "fields": { - "geo_point_2d": [ - 50.6454658887, - 5.578713548 - ], - "title": "Parking Cité administrative", - "house_number": "15", - "available_spaces": 354, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4000, - "gid": 7, - "charging_stations": 2, - "street_name": "quai de la Goffe", - "phone_number": "+32 (0) 4 221 41 45", - "schedule": "24h/24, 7j/7.", - "website": "http://www.interparking.be", - "geo_shape": { - "coordinates": [ - 5.578713548, - 50.6454658887 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-06-11", - "provider": "interparking", - "email": "info@interparking.com" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.578713548, - 50.6454658887 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Saint-Lambert", + "available_spaces": 500, + "created": "2020-09-25", + "schedule": "7j/7 - 24h/24", + "email": "customers@effia.be", + "house_number": "41", + "website": "http://www.mypark.be", + "city": "Liège", + "municipality": "Liège", + "provider": "mypark", + "phone_numbers": "+32 (0) 4 221 61 00" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5727508764, 50.6445693701] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "dfb020b76ee9cdce4306cc3c7d2586b2ca9e28e6", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6401206676, 5.5630714447], + "gid": 15, + "street_name": "rue Jonfosse", + "last_modified": "2024-04-04", + "charging_stations": 2, + "geo_shape": { + "coordinates": [5.5630714447, 50.6401206676], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "5d49d79e39fa79c165ce65158ae802d1b3252635", - "fields": { - "geo_point_2d": [ - 50.6319550955, - 5.5801465473 - ], - "title": "Parking Médiacité", - "house_number": "31", - "available_spaces": 2200, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4020, - "gid": 18, - "charging_stations": 6, - "street_name": "rue Latour", - "phone_number": "+32 (0) 4 342 45 93", - "schedule": "Du lundi au vendredi de 7h00 à 23h00 (jusqu'à minuit en hiver), samedi de 7h00 à 23h00 (jusqu'à 23h30 en hiver) et dimanche uniquement en hiver de 7h00 à 23h30.", - "website": "http://www.mypark.be", - "geo_shape": { - "coordinates": [ - 5.5801465473, - 50.6319550955 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-11-12", - "provider": "mypark", - "email": "lpe@mypark.be" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5801465473, - 50.6319550955 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Carré-Jonfosse", + "available_spaces": 156, + "created": "2020-09-25", + "schedule": "24h/24, 7j/7.", + "email": "customers@effia.be", + "house_number": "62", + "website": "http://www.mypark.be", + "city": "Liège", + "municipality": "Liège", + "provider": "mypark", + "phone_numbers": "+32 (0) 4 221 61 00" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5630714447, 50.6401206676] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "2437b48bf54f28b2da35d9122396b3eac016e9a5", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6428485702, 5.5653716221], + "gid": 25, + "street_name": "boulevard de la Sauvenière", + "last_modified": "2024-03-28", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5653716221, 50.6428485702], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "c9e0c9d06d4fe4e580e1fa0f39aecfab6e05e685", - "fields": { - "geo_point_2d": [ - 50.6276071641, - 5.5643427667 - ], - "title": "Parking Guillemins P3", - "house_number": "4", - "available_spaces": 700, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4000, - "gid": 14, - "charging_stations": 0, - "street_name": "place des Guillemins", - "schedule": "24h/24, 7j/7.", - "website": "https://www.belgiantrain.be/fr/station-information/car-or-bike-at-station/b-parking/my-b-parking/liege-guillemins", - "geo_shape": { - "coordinates": [ - 5.5643427667, - 50.6276071641 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-06-11", - "provider": "SNCB" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5643427667, - 50.6276071641 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Sauvenière", + "available_spaces": 364, + "created": "2020-09-25", + "schedule": "24h/24 - 7j/7", + "house_number": "102", + "website": "https://www.indigoneo.be/fr/parkings/26716/parking-neujean", + "city": "Liège", + "municipality": "Liège", + "provider": "Indigo" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5653716221, 50.6428485702] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "308cc3186464633b583fa6756c2e6e4d021145bc", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6395769799, 5.5713436408], + "gid": 24, + "street_name": "place Saint-Paul", + "last_modified": "2024-03-29", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5713436408, 50.6395769799], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "11ed913c9b02b10730b6c9981c20992b24febcb0", - "fields": { - "geo_point_2d": [ - 50.6241061002, - 5.5658238398 - ], - "title": "Parking Guillemins P1", - "house_number": "8", - "available_spaces": 496, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4000, - "gid": 12, - "charging_stations": 0, - "street_name": "rue Serrurier Bovy", - "schedule": "24h/24, 7j/7.", - "website": "https://www.belgiantrain.be/fr/station-information/car-or-bike-at-station/b-parking/my-b-parking/liege-guillemins", - "geo_shape": { - "coordinates": [ - 5.5658238398, - 50.6241061002 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-06-11", - "provider": "SNCB" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5658238398, - 50.6241061002 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Saint-Paul", + "available_spaces": 400, + "created": "2020-09-25", + "schedule": "24h/24, 7j/7.", + "email": "parking-stpaul@hotmail.com", + "house_number": "3", + "website": "http://www.parkingstpaul.be", + "city": "Liège", + "municipality": "Liège", + "provider": "Saint-Paul", + "phone_numbers": "+32 (0) 4 223 13 56" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5713436408, 50.6395769799] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "a54d6dae43dd6c21fe3a17d868ed4f214217b34c", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6382306915, 5.5754324031], + "gid": 16, + "street_name": "rue André Dumont", + "last_modified": "2024-03-28", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5754324031, 50.6382306915], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "a8ba510087e9744e51de3ea5abc07379dd2a711f", - "fields": { - "geo_point_2d": [ - 50.6430595898, - 5.5710141432 - ], - "title": "Parking Opéra", - "house_number": "11", - "available_spaces": 245, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4000, - "gid": 20, - "charging_stations": 0, - "street_name": "rue Georges Clémenceau", - "phone_number": "+32 (0) 4 223 36 81", - "schedule": "24h/24, 7j/7.", - "website": "https://www.facebook.com/parkingopera/", - "geo_shape": { - "coordinates": [ - 5.5710141432, - 50.6430595898 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-06-11", - "provider": "Opera", - "email": "parkingoperaliege@gmail.com" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5710141432, - 50.6430595898 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Kennedy", + "available_spaces": 66, + "created": "2020-09-25", + "schedule": "24h/24, 7j/7.", + "email": "contact@europarking.be", + "website": "https://uhoda.com/", + "city": "Liège", + "municipality": "Liège", + "provider": "UHODA", + "phone_numbers": "+32 (0) 471 60 82 69" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5754324031, 50.6382306915] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "0ad49eab966a8b45d024701caf6a394ca1ca7b51", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6429408518, 5.5654035149], + "gid": 161, + "street_name": "boulevard de la Sauvenière", + "last_modified": "2024-03-05", + "charging_stations": 0, + "geo_shape": { + "coordinates": [5.5654035149, 50.6429408518], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "89afd2b2c0f17ce83eeed48cb4e988fe6da8f08c", - "fields": { - "geo_point_2d": [ - 50.6459673929, - 5.5680626708 - ], - "title": "Parking Cadran Bons-Enfants", - "house_number": "2", - "available_spaces": 126, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4000, - "gid": 3, - "charging_stations": 2, - "street_name": "rue des Bons Enfants", - "phone_number": "+32 (0) 4 340 49 22", - "schedule": "24h/24, 7j/7.", - "website": "http://www.illico-park.be", - "geo_shape": { - "coordinates": [ - 5.5680626708, - 50.6459673929 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-06-11", - "provider": "illico-park", - "email": "info@illico-park.be" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5680626708, - 50.6459673929 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" + "title": "Parking Sauvenière", + "available_spaces": 18, + "created": "2022-03-17", + "schedule": "24h / 7j", + "email": "info-be@bepark.eu", + "house_number": "100", + "website": "https://www.bepark.eu/fr/parking/wallonie/liege", + "city": "Liège", + "municipality": "Liège", + "provider": "Bepark", + "phone_numbers": "+32(0)28800550" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5654035149, 50.6429408518] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + }, + { + "datasetid": "parkings-voitures-hors-voirie", + "recordid": "26332f5d18ed61b1ad145b876a3d34203d4ba547", + "fields": { + "postal_code": 4000, + "geo_point_2d": [50.6436758876, 5.5676012903], + "gid": 261, + "street_name": "boulevard de la Sauvenière", + "last_modified": "2024-04-08", + "charging_stations": 4, + "geo_shape": { + "coordinates": [5.5676012903, 50.6436758876], + "type": "Point" }, - { - "datasetid": "parkings-voitures-hors-voirie", - "recordid": "5bc622c52fd91de810a36b43df59b9613ddfa467", - "fields": { - "geo_point_2d": [ - 50.6376851177, - 5.5800306678 - ], - "title": "Parking Aquarium", - "house_number": "26", - "available_spaces": 70, - "created": "2020-09-25", - "municipality": "Liège", - "postal_code": 4020, - "gid": 1, - "charging_stations": 0, - "street_name": "rue Méan", - "phone_number": "+32 (0) 4 340 49 22", - "schedule": "24h/24, 7j/7.", - "website": "http://www.illico-park.be", - "geo_shape": { - "coordinates": [ - 5.5800306678, - 50.6376851177 - ], - "type": "Point" - }, - "city": "Liège", - "last_modified": "2021-11-12", - "provider": "illico-park", - "email": "info@illico-park.be" - }, - "geometry": { - "type": "Point", - "coordinates": [ - 5.5800306678, - 50.6376851177 - ] - }, - "record_timestamp": "2022-07-18T22:53:00Z" - } - ] + "title": "Central Park", + "available_spaces": 167, + "created": "2024-03-28", + "schedule": "Du lundi au mercredi de 8h00 à 1h00 / en continu du jeudi au lundi de 8h à 1h00.", + "email": "info@parkingcentral-park.be", + "house_number": "37", + "website": "https://parkingcentral-park.be/", + "city": "Liège", + "municipality": "Liège", + "provider": "Central Park", + "phone_numbers": "+32 (0) 287 12 90" + }, + "geometry": { + "type": "Point", + "coordinates": [5.5676012903, 50.6436758876] + }, + "record_timestamp": "2024-04-18T22:29:00Z" + } + ] } diff --git a/tests/test_liege.py b/tests/test_liege.py index 2c30940..4b13fc4 100644 --- a/tests/test_liege.py +++ b/tests/test_liege.py @@ -15,7 +15,10 @@ @pytest.mark.asyncio -async def test_json_request(aresponses: ResponsesMockServer) -> None: +async def test_json_request( + aresponses: ResponsesMockServer, + odp_liege_client: ODPLiege, +) -> None: """Test JSON response is handled correctly.""" aresponses.add( "opendata.liege.be", @@ -27,11 +30,9 @@ async def test_json_request(aresponses: ResponsesMockServer) -> None: text=load_fixtures("garages.json"), ), ) - async with aiohttp.ClientSession() as session: - client = ODPLiege(session=session) - response = await client._request("test") - assert response is not None - await client.close() + response = await odp_liege_client._request("test") + assert response is not None + await odp_liege_client.close() @pytest.mark.asyncio @@ -80,7 +81,10 @@ async def response_handler(_: aiohttp.ClientResponse) -> Response: @pytest.mark.asyncio -async def test_content_type(aresponses: ResponsesMockServer) -> None: +async def test_content_type( + aresponses: ResponsesMockServer, + odp_liege_client: ODPLiege, +) -> None: """Test request content type error from Open Data Platform API of Liège.""" aresponses.add( "opendata.liege.be", @@ -91,11 +95,8 @@ async def test_content_type(aresponses: ResponsesMockServer) -> None: headers={"Content-Type": "blabla/blabla"}, ), ) - - async with aiohttp.ClientSession() as session: - client = ODPLiege(session=session) - with pytest.raises(ODPLiegeError): - assert await client._request("test") + with pytest.raises(ODPLiegeError): + assert await odp_liege_client._request("test") @pytest.mark.asyncio diff --git a/tests/test_models.py b/tests/test_models.py index f809cbe..6aea427 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -2,17 +2,24 @@ from __future__ import annotations -import aiohttp +from typing import TYPE_CHECKING + import pytest from aresponses import ResponsesMockServer - -from liege import DisabledParking, Garage, ODPLiege +from syrupy.assertion import SnapshotAssertion from . import load_fixtures +if TYPE_CHECKING: + from liege import DisabledParking, Garage, ODPLiege + @pytest.mark.asyncio -async def test_all_garages(aresponses: ResponsesMockServer) -> None: +async def test_all_garages( + aresponses: ResponsesMockServer, + snapshot: SnapshotAssertion, + odp_liege_client: ODPLiege, +) -> None: """Test all garages function.""" aresponses.add( "opendata.liege.be", @@ -24,22 +31,16 @@ async def test_all_garages(aresponses: ResponsesMockServer) -> None: text=load_fixtures("garages.json"), ), ) - async with aiohttp.ClientSession() as session: - client = ODPLiege(session=session) - spaces: list[Garage] = await client.garages() - assert spaces is not None - for item in spaces: - assert isinstance(item, Garage) - assert item.capacity is not None - assert item.url is not None - assert item.longitude is not None - assert item.latitude is not None - assert isinstance(item.longitude, float) - assert isinstance(item.latitude, float) + spaces: list[Garage] = await odp_liege_client.garages() + assert spaces == snapshot @pytest.mark.asyncio -async def test_disabled_parkings(aresponses: ResponsesMockServer) -> None: +async def test_disabled_parkings( + aresponses: ResponsesMockServer, + snapshot: SnapshotAssertion, + odp_liege_client: ODPLiege, +) -> None: """Test disabled parking spaces function.""" aresponses.add( "opendata.liege.be", @@ -51,13 +52,5 @@ async def test_disabled_parkings(aresponses: ResponsesMockServer) -> None: text=load_fixtures("disabled_parkings.json"), ), ) - async with aiohttp.ClientSession() as session: - client = ODPLiege(session=session) - spaces: list[DisabledParking] = await client.disabled_parkings() - assert spaces is not None - for item in spaces: - assert item.spot_id is not None - assert item.longitude is not None - assert item.latitude is not None - assert isinstance(item.longitude, float) - assert isinstance(item.latitude, float) + spaces: list[DisabledParking] = await odp_liege_client.disabled_parkings() + assert spaces == snapshot