mirror of
https://github.com/containers/podman-compose.git
synced 2025-05-06 23:34:43 +02:00
pytests: Add tests for several multi-line environment files
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
This commit is contained in:
parent
f3e9a96c96
commit
040b73adab
@ -251,8 +251,12 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"--env-file",
|
||||
env_file,
|
||||
"-e",
|
||||
"ZZVAR1=podman-rocks-123",
|
||||
"-e",
|
||||
"ZZVAR2=podman-rocks-124",
|
||||
"-e",
|
||||
"ZZVAR3=podman-rocks-125",
|
||||
"--network=bridge",
|
||||
"--network-alias=service_name",
|
||||
"busybox",
|
||||
@ -268,7 +272,7 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
await container_to_args(c, cnt)
|
||||
|
||||
async def test_env_file_str_arr(self):
|
||||
async def test_env_file_str_array_one_path(self):
|
||||
c = create_compose_mock()
|
||||
|
||||
cnt = get_minimal_container()
|
||||
@ -281,8 +285,42 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"--env-file",
|
||||
env_file,
|
||||
"-e",
|
||||
"ZZVAR1=podman-rocks-123",
|
||||
"-e",
|
||||
"ZZVAR2=podman-rocks-124",
|
||||
"-e",
|
||||
"ZZVAR3=podman-rocks-125",
|
||||
"--network=bridge",
|
||||
"--network-alias=service_name",
|
||||
"busybox",
|
||||
],
|
||||
)
|
||||
|
||||
async def test_env_file_str_array_two_paths(self):
|
||||
c = create_compose_mock()
|
||||
|
||||
cnt = get_minimal_container()
|
||||
env_file = path.realpath('tests/env-file-tests/env-files/project-1.env')
|
||||
env_file_2 = path.realpath('tests/env-file-tests/env-files/project-2.env')
|
||||
cnt['env_file'] = [env_file, env_file_2]
|
||||
|
||||
args = await container_to_args(c, cnt)
|
||||
self.assertEqual(
|
||||
args,
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"-e",
|
||||
"ZZVAR1=podman-rocks-123",
|
||||
"-e",
|
||||
"ZZVAR2=podman-rocks-124",
|
||||
"-e",
|
||||
"ZZVAR3=podman-rocks-125",
|
||||
"-e",
|
||||
"ZZVAR1=podman-rocks-223",
|
||||
"-e",
|
||||
"ZZVAR2=podman-rocks-224",
|
||||
"--network=bridge",
|
||||
"--network-alias=service_name",
|
||||
"busybox",
|
||||
@ -302,8 +340,12 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase):
|
||||
[
|
||||
"--name=project_name_service_name1",
|
||||
"-d",
|
||||
"--env-file",
|
||||
env_file,
|
||||
"-e",
|
||||
"ZZVAR1=podman-rocks-123",
|
||||
"-e",
|
||||
"ZZVAR2=podman-rocks-124",
|
||||
"-e",
|
||||
"ZZVAR3=podman-rocks-125",
|
||||
"--network=bridge",
|
||||
"--network-alias=service_name",
|
||||
"busybox",
|
||||
|
@ -1 +1,3 @@
|
||||
ZZVAR1=podman-rocks-123
|
||||
ZZVAR2=podman-rocks-124
|
||||
ZZVAR3=podman-rocks-125
|
||||
|
2
tests/env-file-tests/env-files/project-2.env
Normal file
2
tests/env-file-tests/env-files/project-2.env
Normal file
@ -0,0 +1,2 @@
|
||||
ZZVAR1=podman-rocks-223
|
||||
ZZVAR2=podman-rocks-224
|
Loading…
Reference in New Issue
Block a user