Skip to content

Commit

Permalink
Added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
muffato committed Dec 20, 2024
1 parent 9dcb4a0 commit 7b931f1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,26 @@ def test_get_repo_releases_branches_not_exists_slash(self):
with pytest.raises(AssertionError):
nf_core.utils.get_repo_releases_branches("made-up/pipeline", wfs)

def test_get_repo_commit(self):
# The input can be a commit in standard long/short form, but also any length as long as it can be uniquely resolved
assert (
nf_core.utils.get_repo_commit("nf-core/methylseq", "b3e5e3b95aaf01d98391a62a10a3990c0a4de395")
== "b3e5e3b95aaf01d98391a62a10a3990c0a4de395"
)
assert (
nf_core.utils.get_repo_commit("nf-core/methylseq", "b3e5e3b95aaf01d")
== "b3e5e3b95aaf01d98391a62a10a3990c0a4de395"
)
assert (
nf_core.utils.get_repo_commit("nf-core/methylseq", "b3e5e3b") == "b3e5e3b95aaf01d98391a62a10a3990c0a4de395"
)
assert (
nf_core.utils.get_repo_commit("nf-core/methylseq", "b3e5e3") == "b3e5e3b95aaf01d98391a62a10a3990c0a4de395"
)
assert nf_core.utils.get_repo_commit("nf-core/methylseq", "xyz") is None
assert nf_core.utils.get_repo_commit("made_up_pipeline", "") is None
assert nf_core.utils.get_repo_commit("made-up/pipeline", "") is None

def test_validate_file_md5(self):
# MD5(test) = d8e8fca2dc0f896fd7cb4cb0031ba249
test_file = TEST_DATA_DIR / "test.txt"
Expand Down

0 comments on commit 7b931f1

Please sign in to comment.