conftest.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # location-guessing-game-telegram-bot - Telegram Bot Sending Random Wikimedia Commons Photos
  2. #
  3. # Copyright (C) 2021 Fabian Peter Hammerle <fabian@hammerle.me>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. import json
  18. import pathlib
  19. import pytest
  20. @pytest.fixture(scope="session")
  21. def wikimap_export_path() -> pathlib.Path:
  22. return pathlib.Path(__file__).parent.joinpath(
  23. "resources",
  24. "wikimap.toolforge.org",
  25. "api.php@cat=Images_with_annotations&lang=de&year=2020-2020&region=48%7C12%7C47%7C13",
  26. )
  27. # pylint: disable=redefined-outer-name; fixture
  28. @pytest.fixture(scope="session")
  29. def wikimap_export(wikimap_export_path) -> pathlib.Path:
  30. return json.loads(wikimap_export_path.read_text())