test_download.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # import pytest
  2. # import requests
  3. #
  4. # from faostat_data_primap.download import (
  5. # calculate_checksum,
  6. # download_methodology,
  7. # find_previous_release_path,
  8. # )
  9. #
  10. #
  11. # @pytest.fixture
  12. # def temp_domain_directories(tmp_path):
  13. # """
  14. # Sets up a temporary directory structure for domains and releases for testing.
  15. #
  16. # Parameters
  17. # ----------
  18. # tmp_path : pathlib.Path
  19. # A pytest-provided temporary directory path.
  20. #
  21. # Returns
  22. # -------
  23. # dict
  24. # A dictionary containing the paths to the `downloaded_data` directory,
  25. # the specific domain directory, and a list of sorted release paths.
  26. # """
  27. # downloaded_data = tmp_path / "downloaded_data"
  28. # downloaded_data.mkdir()
  29. #
  30. # domains = (
  31. # "farm_gate_emissions_crops",
  32. # "farm_gate_livestock",
  33. # "farm_gate_agriculture_energy",
  34. # "land_use_forests",
  35. # "land_use_fires",
  36. # "land_use_drained_organic_soils",
  37. # "pre_post_agricultural_production",
  38. # )
  39. # domain_paths = []
  40. #
  41. # for domain in domains:
  42. # domain_path = downloaded_data / domain
  43. # domain_path.mkdir()
  44. # domain_paths.append(domain_path)
  45. #
  46. # return {
  47. # "downloaded_data": downloaded_data,
  48. # "domain_paths": domain_paths,
  49. # }