tests/integration: Add type annotations

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
Povilas Kanapickas
2025-05-24 17:10:15 +03:00
parent dedb081550
commit a3f48f830d
46 changed files with 175 additions and 167 deletions

View File

@ -9,7 +9,7 @@ from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path():
def compose_yaml_path() -> str:
return os.path.join(
test_path(),
"merge/reset_and_override_tags/override_tag_attribute/docker-compose.yaml",
@ -18,7 +18,7 @@ def compose_yaml_path():
class TestComposeOverrideTagAttribute(unittest.TestCase, RunSubprocessMixin):
# test if a service attribute from docker-compose.yaml file is overridden
def test_override_tag_attribute(self):
def test_override_tag_attribute(self) -> None:
override_file = os.path.join(
test_path(),
"merge/reset_and_override_tags/override_tag_attribute/docker-compose.override_attribute.yaml",

View File

@ -9,7 +9,7 @@ from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path():
def compose_yaml_path() -> str:
return os.path.join(
test_path(),
"merge/reset_and_override_tags/override_tag_service/docker-compose.yaml",
@ -18,7 +18,7 @@ def compose_yaml_path():
class TestComposeOverrideTagService(unittest.TestCase, RunSubprocessMixin):
# test if whole service from docker-compose.yaml file is overridden in another file
def test_override_tag_service(self):
def test_override_tag_service(self) -> None:
override_file = os.path.join(
test_path(),
"merge/reset_and_override_tags/override_tag_service/docker-compose.override_service.yaml",

View File

@ -8,7 +8,7 @@ from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path():
def compose_yaml_path() -> str:
return os.path.join(
test_path(),
"merge/reset_and_override_tags/reset_tag_attribute/docker-compose.yaml",
@ -17,7 +17,7 @@ def compose_yaml_path():
class TestComposeResetTagAttribute(unittest.TestCase, RunSubprocessMixin):
# test if the attribute of the service is correctly reset
def test_reset_tag_attribute(self):
def test_reset_tag_attribute(self) -> None:
reset_file = os.path.join(
test_path(),
"merge/reset_and_override_tags/reset_tag_attribute/docker-compose.reset_attribute.yaml",

View File

@ -8,7 +8,7 @@ from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path():
def compose_yaml_path() -> str:
return os.path.join(
test_path(), "merge/reset_and_override_tags/reset_tag_service/docker-compose.yaml"
)
@ -16,7 +16,7 @@ def compose_yaml_path():
class TestComposeResetTagService(unittest.TestCase, RunSubprocessMixin):
# test if whole service from docker-compose.yaml file is reset
def test_reset_tag_service(self):
def test_reset_tag_service(self) -> None:
reset_file = os.path.join(
test_path(),
"merge/reset_and_override_tags/reset_tag_service/docker-compose.reset_service.yaml",

View File

@ -9,14 +9,14 @@ from tests.integration.test_utils import podman_compose_path
from tests.integration.test_utils import test_path
def compose_yaml_path(compose_name):
def compose_yaml_path(compose_name: str) -> str:
""" "Returns the path to the compose file used for this test module"""
base_path = os.path.join(test_path(), "merge/volumes_merge/")
return os.path.join(base_path, compose_name)
class TestComposeVolumesMerge(unittest.TestCase, RunSubprocessMixin):
def test_volumes_merge(self):
def test_volumes_merge(self) -> None:
# test if additional compose file overrides host path and access mode of a volume
try:
self.run_subprocess_assert_returncode([