Skip to content

Commit 10f41a4

Browse files
committed
Add tests for tag validation
1 parent 227b2c1 commit 10f41a4

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

tests/test_docker_utils.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import warnings
2+
import pytest
3+
from PyStemmusScope.bmi import docker_utils
4+
5+
6+
def test_check_tags():
7+
with warnings.catch_warnings():
8+
warnings.simplefilter("error")
9+
docker_utils.check_tags(
10+
image="ghcr.io/ecoextreml/stemmus_scope:1.5.0",
11+
compatible_tags=("1.5.0"),
12+
)
13+
14+
15+
def test_check_missing_tag():
16+
with pytest.warns(UserWarning, match="no tag was provided"):
17+
docker_utils.check_tags(
18+
image="ghcr.io/ecoextreml/stemmus_scope",
19+
compatible_tags=("none"),
20+
)
21+
22+
23+
def test_incompatible_tag():
24+
with pytest.warns(UserWarning, match="unexpected results"):
25+
docker_utils.check_tags(
26+
image="ghcr.io/ecoextreml/stemmus_scope:1.6.0",
27+
compatible_tags=("1.5.0", "1.5.1"),
28+
)

0 commit comments

Comments
 (0)