Skip to content

Commit

Permalink
Move OpeneoApiCollectionTests under openeo_test_suite/lib
Browse files Browse the repository at this point in the history
Better separation of actual tests and reusable components

Also make sure the asserts in OpeneoApiCollectionTests are rewritten for
better reporting quality
  • Loading branch information
soxofaan committed Aug 19, 2024
1 parent 4ab1789 commit 136f453
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/openeo_test_suite/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest

# Register some helper modules for assert rewriting to improve test reporting
pytest.register_assert_rewrite(
"openeo_test_suite.lib.collection_metadata",
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class OpeneoApiCollectionTests:
# TODO: This OOP pattern is not necessary, this can just be a bunch of functions. These addition layers leak into the test report, making it harder to read.
# TODO: This OOP pattern is not necessary, this can just be a bunch of functions. These additional layers leak into the test report, making it harder to read.
# TODO: Also, it's not necessary to define this in a separate file, it can just be a function in the test file
def __init__(self, collection):
self.test_stac_version(collection)
Expand Down
4 changes: 1 addition & 3 deletions src/openeo_test_suite/tests/collections/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from stac_validator import stac_validator

from openeo_test_suite.lib.backend_under_test import get_collection_ids
from openeo_test_suite.lib.collection_metadata import OpeneoApiCollectionTests
from openeo_test_suite.lib.validate_stac import validate_stac_dict
from openeo_test_suite.tests.collections.openeo_api_collection_tests import (
OpeneoApiCollectionTests,
)

_log = logging.getLogger(__name__)

Expand Down

0 comments on commit 136f453

Please sign in to comment.