Skip to content

Commit

Permalink
Add tests for tag validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Jan 26, 2024
1 parent 09a52c1 commit 1667729
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_docker_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import warnings
import pytest
from PyStemmusScope.bmi import docker_utils


def test_check_tags():
with warnings.catch_warnings():
warnings.simplefilter("error")
docker_utils.check_tags(
image="ghcr.io/ecoextreml/stemmus_scope:1.5.0",
compatible_tags=("1.5.0"),
)


def test_check_missing_tag():
with pytest.warns(UserWarning, match="no tag was provided"):
docker_utils.check_tags(
image="ghcr.io/ecoextreml/stemmus_scope",
compatible_tags=("none"),
)


def test_incompatible_tag():
with pytest.warns(UserWarning, match="unexpected results"):
docker_utils.check_tags(
image="ghcr.io/ecoextreml/stemmus_scope:1.6.0",
compatible_tags=("1.5.0", "1.5.1"),
)

0 comments on commit 1667729

Please sign in to comment.