diff --git a/tests/integration/network/__init__.py b/tests/integration/network/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tests/integration/network/__init__.py @@ -0,0 +1 @@ + diff --git a/tests/integration/test_podman_compose_networks.py b/tests/integration/network/test_podman_compose_network.py similarity index 78% rename from tests/integration/test_podman_compose_networks.py rename to tests/integration/network/test_podman_compose_network.py index de3982b..a7d251b 100644 --- a/tests/integration/test_podman_compose_networks.py +++ b/tests/integration/network/test_podman_compose_network.py @@ -114,3 +114,28 @@ class TestPodmanComposeNetwork(RunSubprocessMixin, unittest.TestCase): ip, mac = values self.assertIn(f"ether {mac}", out.decode('utf-8')) self.assertIn(f"inet {ip}/", out.decode('utf-8')) + + def test_down_with_network(self): + try: + self.run_subprocess_assert_returncode([ + "coverage", + "run", + podman_compose_path(), + "-f", + os.path.join(test_path(), "network", "docker-compose.yml"), + "up", + "-d", + ]) + output, _, _ = self.run_subprocess(["podman", "network", "ls"]) + self.assertIn("network_mystack", output.decode()) + finally: + self.run_subprocess_assert_returncode([ + "coverage", + "run", + podman_compose_path(), + "-f", + os.path.join(test_path(), "network", "docker-compose.yml"), + "down", + ]) + output, _, _ = self.run_subprocess(["podman", "network", "ls"]) + self.assertNotIn("network_mystack", output.decode()) diff --git a/tests/integration/test_podman_compose_tests.py b/tests/integration/test_podman_compose_tests.py index 8b1cecc..e44cce0 100644 --- a/tests/integration/test_podman_compose_tests.py +++ b/tests/integration/test_podman_compose_tests.py @@ -122,28 +122,3 @@ class TestPodmanCompose(unittest.TestCase, RunSubprocessMixin): ], 1, ) - - def test_down_with_network(self): - try: - self.run_subprocess_assert_returncode([ - "coverage", - "run", - podman_compose_path(), - "-f", - os.path.join(test_path(), "network", "docker-compose.yml"), - "up", - "-d", - ]) - output, _, _ = self.run_subprocess(["podman", "network", "ls"]) - self.assertIn("network_mystack", output.decode()) - finally: - self.run_subprocess_assert_returncode([ - "coverage", - "run", - podman_compose_path(), - "-f", - os.path.join(test_path(), "network", "docker-compose.yml"), - "down", - ]) - output, _, _ = self.run_subprocess(["podman", "network", "ls"]) - self.assertNotIn("network_mystack", output.decode())