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

@ -10,20 +10,20 @@ 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(os.path.join(test_path(), "nethost"), "docker-compose.yaml")
class TestComposeNethost(unittest.TestCase, RunSubprocessMixin):
# check if container listens for http requests and sends response back
# as network_mode: host allows to connect to container easily
def test_nethost(self):
def test_nethost(self) -> None:
try:
self.run_subprocess_assert_returncode(
[podman_compose_path(), "-f", compose_yaml_path(), "up", "-d"],
)
container_id, _ = self.run_subprocess_assert_returncode(
container_id_out, _ = self.run_subprocess_assert_returncode(
[
podman_compose_path(),
"-f",
@ -33,7 +33,7 @@ class TestComposeNethost(unittest.TestCase, RunSubprocessMixin):
'{{.ID}}',
],
)
container_id = container_id.decode('utf-8').split('\n')[0]
container_id = container_id_out.decode('utf-8').split('\n')[0]
output, _ = self.run_subprocess_assert_returncode(
[
"podman",