This repository was archived by the owner on Aug 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Decouple TestGithubAlgorithmRepository tests from real github repo #4
Copy link
Copy link
Open
Description
esa-apex-toolbox-python/tests/test_algorithms.py
Lines 184 to 209 in 96cec28
| class TestGithubAlgorithmRepository: | |
| @pytest.fixture | |
| def repo(self) -> GithubAlgorithmRepository: | |
| # TODO: avoid depending on an actual GitHub repository. Mock it instead? | |
| # Or run this as an integration test? | |
| return GithubAlgorithmRepository( | |
| owner="ESA-APEx", | |
| repo="apex_algorithms", | |
| folder="algorithm_catalog", | |
| ) | |
| def test_list_algorithms(self, repo): | |
| assert repo.list_algorithms() == [ | |
| "worldcereal.json", | |
| ] | |
| def test_get_algorithm(self, repo): | |
| algorithm = repo.get_algorithm("worldcereal.json") | |
| assert algorithm == Algorithm( | |
| id="worldcereal_maize", | |
| title="ESA worldcereal global maize detector", | |
| description="A maize detection algorithm.", | |
| udp_link=UdpLink( | |
| href="https://github.com/ESA-APEX/apex_algorithms/blob/main/openeo_udp/worldcereal_inference.json", | |
| title="openEO UDP", | |
| ), |
these tests depend on actual data in real github repo.
Was originally done as proof of concept, to have something in place, but obviously this is to brittle to keep like that (e.g. also see #3)
actual repo should be replaced with mock
Metadata
Metadata
Assignees
Labels
No labels