Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple TestGithubAlgorithmRepository tests from real github repo #4

Open
soxofaan opened this issue Dec 11, 2024 · 0 comments
Open
Assignees

Comments

@soxofaan
Copy link
Contributor

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

soxofaan added a commit that referenced this issue Dec 11, 2024
@soxofaan soxofaan self-assigned this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant