From 58df8497aa9d00b56fdfa700e0095554d567431a Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Thu, 24 Apr 2025 20:16:34 +0300 Subject: [PATCH] Move tests to directories that can be imported Signed-off-by: Povilas Kanapickas --- tests/integration/env-file-tests/.env | 2 -- tests/integration/env_file_tests/.env | 2 ++ .../{env-file-tests => env_file_tests}/.gitignore | 0 .../{env-file-tests => env_file_tests}/__init__.py | 0 .../env-files/project-1.env | 0 .../env-files/project-2.env | 0 .../{env-file-tests => env_file_tests}/project/.env | 0 .../project/container-compose.env-file-flat.yaml | 0 ...container-compose.env-file-obj-optional-exists.yaml | 0 ...ontainer-compose.env-file-obj-optional-missing.yaml | 0 .../project/container-compose.env-file-obj.yaml | 0 .../container-compose.load-.env-in-project.yaml | 0 .../project/container-compose.yaml | 0 .../test_podman_compose_env_file.py | 2 +- tests/integration/{env-tests => env_tests}/__init__.py | 0 .../{env-tests => env_tests}/container-compose.yml | 0 .../test_podman_compose_env.py | 2 +- tests/integration/{exit-from => exit_from}/__init__.py | 0 .../{exit-from => exit_from}/docker-compose.yaml | 0 .../test_podman_compose_exit_from.py | 4 ++-- tests/unit/test_container_to_args.py | 10 +++++----- 21 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 tests/integration/env-file-tests/.env create mode 100644 tests/integration/env_file_tests/.env rename tests/integration/{env-file-tests => env_file_tests}/.gitignore (100%) rename tests/integration/{env-file-tests => env_file_tests}/__init__.py (100%) rename tests/integration/{env-file-tests => env_file_tests}/env-files/project-1.env (100%) rename tests/integration/{env-file-tests => env_file_tests}/env-files/project-2.env (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/.env (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/container-compose.env-file-flat.yaml (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/container-compose.env-file-obj-optional-exists.yaml (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/container-compose.env-file-obj-optional-missing.yaml (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/container-compose.env-file-obj.yaml (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/container-compose.load-.env-in-project.yaml (100%) rename tests/integration/{env-file-tests => env_file_tests}/project/container-compose.yaml (100%) rename tests/integration/{env-file-tests => env_file_tests}/test_podman_compose_env_file.py (99%) rename tests/integration/{env-tests => env_tests}/__init__.py (100%) rename tests/integration/{env-tests => env_tests}/container-compose.yml (100%) rename tests/integration/{env-tests => env_tests}/test_podman_compose_env.py (97%) rename tests/integration/{exit-from => exit_from}/__init__.py (100%) rename tests/integration/{exit-from => exit_from}/docker-compose.yaml (100%) rename tests/integration/{exit-from => exit_from}/test_podman_compose_exit_from.py (92%) diff --git a/tests/integration/env-file-tests/.env b/tests/integration/env-file-tests/.env deleted file mode 100644 index 0c167ce..0000000 --- a/tests/integration/env-file-tests/.env +++ /dev/null @@ -1,2 +0,0 @@ -ZZVAR1='This value is overwritten by env-file-tests/.env' -ZZVAR3='This value is loaded from env-file-tests/.env' diff --git a/tests/integration/env_file_tests/.env b/tests/integration/env_file_tests/.env new file mode 100644 index 0000000..3a52912 --- /dev/null +++ b/tests/integration/env_file_tests/.env @@ -0,0 +1,2 @@ +ZZVAR1='This value is overwritten by env_file_tests/.env' +ZZVAR3='This value is loaded from env_file_tests/.env' diff --git a/tests/integration/env-file-tests/.gitignore b/tests/integration/env_file_tests/.gitignore similarity index 100% rename from tests/integration/env-file-tests/.gitignore rename to tests/integration/env_file_tests/.gitignore diff --git a/tests/integration/env-file-tests/__init__.py b/tests/integration/env_file_tests/__init__.py similarity index 100% rename from tests/integration/env-file-tests/__init__.py rename to tests/integration/env_file_tests/__init__.py diff --git a/tests/integration/env-file-tests/env-files/project-1.env b/tests/integration/env_file_tests/env-files/project-1.env similarity index 100% rename from tests/integration/env-file-tests/env-files/project-1.env rename to tests/integration/env_file_tests/env-files/project-1.env diff --git a/tests/integration/env-file-tests/env-files/project-2.env b/tests/integration/env_file_tests/env-files/project-2.env similarity index 100% rename from tests/integration/env-file-tests/env-files/project-2.env rename to tests/integration/env_file_tests/env-files/project-2.env diff --git a/tests/integration/env-file-tests/project/.env b/tests/integration/env_file_tests/project/.env similarity index 100% rename from tests/integration/env-file-tests/project/.env rename to tests/integration/env_file_tests/project/.env diff --git a/tests/integration/env-file-tests/project/container-compose.env-file-flat.yaml b/tests/integration/env_file_tests/project/container-compose.env-file-flat.yaml similarity index 100% rename from tests/integration/env-file-tests/project/container-compose.env-file-flat.yaml rename to tests/integration/env_file_tests/project/container-compose.env-file-flat.yaml diff --git a/tests/integration/env-file-tests/project/container-compose.env-file-obj-optional-exists.yaml b/tests/integration/env_file_tests/project/container-compose.env-file-obj-optional-exists.yaml similarity index 100% rename from tests/integration/env-file-tests/project/container-compose.env-file-obj-optional-exists.yaml rename to tests/integration/env_file_tests/project/container-compose.env-file-obj-optional-exists.yaml diff --git a/tests/integration/env-file-tests/project/container-compose.env-file-obj-optional-missing.yaml b/tests/integration/env_file_tests/project/container-compose.env-file-obj-optional-missing.yaml similarity index 100% rename from tests/integration/env-file-tests/project/container-compose.env-file-obj-optional-missing.yaml rename to tests/integration/env_file_tests/project/container-compose.env-file-obj-optional-missing.yaml diff --git a/tests/integration/env-file-tests/project/container-compose.env-file-obj.yaml b/tests/integration/env_file_tests/project/container-compose.env-file-obj.yaml similarity index 100% rename from tests/integration/env-file-tests/project/container-compose.env-file-obj.yaml rename to tests/integration/env_file_tests/project/container-compose.env-file-obj.yaml diff --git a/tests/integration/env-file-tests/project/container-compose.load-.env-in-project.yaml b/tests/integration/env_file_tests/project/container-compose.load-.env-in-project.yaml similarity index 100% rename from tests/integration/env-file-tests/project/container-compose.load-.env-in-project.yaml rename to tests/integration/env_file_tests/project/container-compose.load-.env-in-project.yaml diff --git a/tests/integration/env-file-tests/project/container-compose.yaml b/tests/integration/env_file_tests/project/container-compose.yaml similarity index 100% rename from tests/integration/env-file-tests/project/container-compose.yaml rename to tests/integration/env_file_tests/project/container-compose.yaml diff --git a/tests/integration/env-file-tests/test_podman_compose_env_file.py b/tests/integration/env_file_tests/test_podman_compose_env_file.py similarity index 99% rename from tests/integration/env-file-tests/test_podman_compose_env_file.py rename to tests/integration/env_file_tests/test_podman_compose_env_file.py index 5676dc9..e3ab83b 100644 --- a/tests/integration/env-file-tests/test_podman_compose_env_file.py +++ b/tests/integration/env_file_tests/test_podman_compose_env_file.py @@ -9,7 +9,7 @@ from tests.integration.test_utils import test_path def compose_base_path(): - return os.path.join(test_path(), "env-file-tests") + return os.path.join(test_path(), "env_file_tests") class TestComposeEnvFile(unittest.TestCase, RunSubprocessMixin): diff --git a/tests/integration/env-tests/__init__.py b/tests/integration/env_tests/__init__.py similarity index 100% rename from tests/integration/env-tests/__init__.py rename to tests/integration/env_tests/__init__.py diff --git a/tests/integration/env-tests/container-compose.yml b/tests/integration/env_tests/container-compose.yml similarity index 100% rename from tests/integration/env-tests/container-compose.yml rename to tests/integration/env_tests/container-compose.yml diff --git a/tests/integration/env-tests/test_podman_compose_env.py b/tests/integration/env_tests/test_podman_compose_env.py similarity index 97% rename from tests/integration/env-tests/test_podman_compose_env.py rename to tests/integration/env_tests/test_podman_compose_env.py index f1c35cf..fc2020b 100644 --- a/tests/integration/env-tests/test_podman_compose_env.py +++ b/tests/integration/env_tests/test_podman_compose_env.py @@ -9,7 +9,7 @@ from tests.integration.test_utils import test_path def compose_yaml_path(): - return os.path.join(os.path.join(test_path(), "env-tests"), "container-compose.yml") + return os.path.join(os.path.join(test_path(), "env_tests"), "container-compose.yml") class TestComposeEnv(unittest.TestCase, RunSubprocessMixin): diff --git a/tests/integration/exit-from/__init__.py b/tests/integration/exit_from/__init__.py similarity index 100% rename from tests/integration/exit-from/__init__.py rename to tests/integration/exit_from/__init__.py diff --git a/tests/integration/exit-from/docker-compose.yaml b/tests/integration/exit_from/docker-compose.yaml similarity index 100% rename from tests/integration/exit-from/docker-compose.yaml rename to tests/integration/exit_from/docker-compose.yaml diff --git a/tests/integration/exit-from/test_podman_compose_exit_from.py b/tests/integration/exit_from/test_podman_compose_exit_from.py similarity index 92% rename from tests/integration/exit-from/test_podman_compose_exit_from.py rename to tests/integration/exit_from/test_podman_compose_exit_from.py index 1d36b9d..c0b2d3e 100644 --- a/tests/integration/exit-from/test_podman_compose_exit_from.py +++ b/tests/integration/exit_from/test_podman_compose_exit_from.py @@ -9,7 +9,7 @@ from tests.integration.test_utils import test_path def compose_yaml_path(): - return os.path.join(os.path.join(test_path(), "exit-from"), "docker-compose.yaml") + return os.path.join(os.path.join(test_path(), "exit_from"), "docker-compose.yaml") class TestComposeExitFrom(unittest.TestCase, RunSubprocessMixin): @@ -59,7 +59,7 @@ class TestComposeExitFrom(unittest.TestCase, RunSubprocessMixin): "run", podman_compose_path(), "-f", - os.path.join(test_path(), "exit-from", "docker-compose.yaml"), + compose_yaml_path(), "up", ] diff --git a/tests/unit/test_container_to_args.py b/tests/unit/test_container_to_args.py index fc1085f..601c09c 100644 --- a/tests/unit/test_container_to_args.py +++ b/tests/unit/test_container_to_args.py @@ -262,7 +262,7 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase): c = create_compose_mock() cnt = get_minimal_container() - env_file = get_test_file_path('tests/integration/env-file-tests/env-files/project-1.env') + env_file = get_test_file_path('tests/integration/env_file_tests/env-files/project-1.env') cnt['env_file'] = env_file args = await container_to_args(c, cnt) @@ -295,7 +295,7 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase): c = create_compose_mock() cnt = get_minimal_container() - env_file = get_test_file_path('tests/integration/env-file-tests/env-files/project-1.env') + env_file = get_test_file_path('tests/integration/env_file_tests/env-files/project-1.env') cnt['env_file'] = [env_file] args = await container_to_args(c, cnt) @@ -319,8 +319,8 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase): c = create_compose_mock() cnt = get_minimal_container() - env_file = get_test_file_path('tests/integration/env-file-tests/env-files/project-1.env') - env_file_2 = get_test_file_path('tests/integration/env-file-tests/env-files/project-2.env') + env_file = get_test_file_path('tests/integration/env_file_tests/env-files/project-1.env') + env_file_2 = get_test_file_path('tests/integration/env_file_tests/env-files/project-2.env') cnt['env_file'] = [env_file, env_file_2] args = await container_to_args(c, cnt) @@ -348,7 +348,7 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase): c = create_compose_mock() cnt = get_minimal_container() - env_file = get_test_file_path('tests/integration/env-file-tests/env-files/project-1.env') + env_file = get_test_file_path('tests/integration/env_file_tests/env-files/project-1.env') cnt['env_file'] = {'path': env_file, 'required': True} args = await container_to_args(c, cnt)