Debian Codegraph @

tests/integration/extends_w_file/test_podman_compose_extends_w_file.py

raw symbols SCIP
1 # SPDX-License-Identifier: GPL-2.0
2
3 import os
4 import unittest
5
6 from tests.integration.test_utils import RunSubprocessMixin
7 from tests.integration.test_utils import podman_compose_path
8 from tests.integration.test_utils import test_path
9
10
11 def compose_yaml_path() -> str:
12 return os.path.join(os.path.join(test_path(), "extends_w_file"), "docker-compose.yml")
13
14
15 class TestComposeExtendsWithFile(unittest.TestCase, RunSubprocessMixin):
16 def test_extends_w_file(self) -> None: # when file is Dockerfile for building the image
17 try:
18 self.run_subprocess_assert_returncode(
19 [
20 podman_compose_path(),
21 "-f",
22 compose_yaml_path(),
23 "up",
24 ],
25 )
26 output, _ = self.run_subprocess_assert_returncode([
27 podman_compose_path(),
28 "-f",
29 compose_yaml_path(),
30 "ps",
31 ])
32 self.assertIn("extends_w_file_web_1", str(output))
33 self.assertIn("extends_w_file_important_web_1", str(output))
34 finally:
35 self.run_subprocess_assert_returncode([
36 podman_compose_path(),
37 "-f",
38 compose_yaml_path(),
39 "down",
40 ])