Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Decouple TestGithubAlgorithmRepository tests from real github repo #4

@soxofaan

Description

@soxofaan

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions