123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import pytest
- from location_guessing_game_telegram_bot import _Photo
- @pytest.mark.parametrize(
- ("index", "expected_vars"),
- (
- (
- 0,
- {
- "description_url": "https://commons.wikimedia.org/wiki"
- "/File:H%C3%BCtteltalkopf_(Venedigergruppe)_from_Tristkopf.jpg",
- "latitude": 47.288805,
- "longitude": 12.144116,
- "photo_url": "https://upload.wikimedia.org/wikipedia/commons/a/ab"
- "/H%C3%BCtteltalkopf_%28Venedigergruppe%29_from_Tristkopf.jpg",
- },
- ),
- (
- 1,
- {
- "description_url": "https://commons.wikimedia.org/wiki"
- "/File:Gro%C3%9Fvenediger3.JPG",
- "latitude": 47.24854167,
- "longitude": 12.25381667,
- "photo_url": "https://upload.wikimedia.org/wikipedia/commons/6/65"
- "/Gro%C3%9Fvenediger3.JPG",
- },
- ),
-
- (
- 8,
- {
- "description_url": "https://commons.wikimedia.org/wiki"
- "/File:Kasern_-_hinteres_Ahrntal.JPG",
- "latitude": 47.06111,
- "longitude": 12.15333,
- "photo_url": "https://upload.wikimedia.org/wikipedia/commons/c/ce"
- "/Kasern_-_hinteres_Ahrntal.JPG",
- },
- ),
- ),
- )
- def test_from_wikimap_export(wikimap_export, index, expected_vars):
-
- assert vars(_Photo.from_wikimap_export(wikimap_export[index])) == expected_vars
- def test___str__():
- assert (
- str(
- _Photo(
- photo_url="https://upload.wikimedia.org/wikipedia/commons/6/65"
- "/Gro%C3%9Fvenediger3.JPG",
- description_url="https://commons.wikimedia.org/wiki"
- "/File:Gro%C3%9Fvenediger3.JPG",
- latitude=47.24854167,
- longitude=12.25381667,
- )
- )
- == "photo https://commons.wikimedia.org/wiki/File:Gro%C3%9Fvenediger3.JPG"
- )
|