-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linting/checks against using "feature branch" references #48
- Loading branch information
Showing
6 changed files
with
90 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
from apex_algorithm_qa_tools.common import get_project_root | ||
import pytest | ||
from apex_algorithm_qa_tools.common import ( | ||
assert_no_github_feature_branch_refs, | ||
get_project_root, | ||
) | ||
|
||
|
||
def test_get_project_root(): | ||
assert get_project_root().is_dir() | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"href", | ||
[ | ||
"https://example.com/foo/bar", | ||
"https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/refs/heads/main/openeo_udp/examples/max_ndvi_composite/max_ndvi_composite.json", | ||
"https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/main/openeo_udp/examples/max_ndvi_composite/max_ndvi_composite.json" | ||
"https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/3b5a011a90f4a3050ff8fdf69ca5bc2fd1535881/openeo_udp/biopar/biopar.json", | ||
], | ||
) | ||
def test_assert_no_github_feature_branch_refs_ok(href): | ||
assert_no_github_feature_branch_refs(href) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
["href", "expected_error"], | ||
[ | ||
( | ||
"https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/refs/heads/footurebranch/openeo_udp/examples/max_ndvi_composite/max_ndvi_composite.json", | ||
"should not point to ephemeral feature branches: found 'footurebranch'", | ||
), | ||
( | ||
"https://raw.githubusercontent.com/ESA-APEx/apex_algorithms/footurebranch/openeo_udp/examples/max_ndvi_composite/max_ndvi_composite.json", | ||
"should not point to ephemeral feature branches: found 'footurebranch'", | ||
), | ||
], | ||
) | ||
def test_assert_no_github_feature_branch_refs_not_ok(href, expected_error): | ||
with pytest.raises(ValueError, match=expected_error): | ||
assert_no_github_feature_branch_refs(href) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters