Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/tests/compose_generator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def get_compose_with_environment_file_single():
services:
frontend:
image: awesome/webapp
env_file: ./sample/test.env
env_file: ./src/tests/sample/test.env
environment:
- RACK_ENV=development
- SHOW=true
Expand All @@ -414,9 +414,9 @@ def get_compose_with_environment_file_list():
frontend:
image: awesome/webapp
env_file:
- ./sample/common.env
- ./sample/apps/web.env
- ./sample/opt/runtime_opts.env
- ./src/tests/sample/common.env
- ./src/tests/sample/apps/web.env
- ./src/tests/sample/opt/runtime_opts.env
environment:
- RACK_ENV=canary
- SHOW=true
Expand Down Expand Up @@ -482,7 +482,7 @@ def get_compose_with_one_secret():
- my_secret
secrets:
my_secret:
file: ./sample/my_secret.txt
file: ./src/tests/sample/my_secret.txt
"""
return ComposeGenerator.convert_yaml_to_compose_file(compose)

Expand Down Expand Up @@ -514,7 +514,7 @@ def get_compose_with_long_syntax():
mode: 0440
secrets:
my_secret:
file: ./sample/my_secret.txt
file: ./src/tests/sample/my_secret.txt
my_other_secret:
external: true
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/tests/service/test_service_environment_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_service_with_single_environment_file(self):
compose_file = ComposeGenerator.get_compose_with_environment_file_single()
environment_from_file = compose_file.services["frontend"].env_file.readFile()

self.assertEqual(compose_file.services["frontend"].env_file[0], "./sample/test.env")
self.assertEqual(compose_file.services["frontend"].env_file[0], "./src/tests/sample/test.env")
self.assertEqual(environment_from_file["RACK_ENV"], "development")
self.assertEqual(environment_from_file["VAR"], '"quoted"')
self.assertEqual(environment_from_file["SOME_VAR"], '"value with equals=sign"')
Expand All @@ -17,7 +17,7 @@ def test_service_with_list_environment_file(self):
compose_file = ComposeGenerator.get_compose_with_environment_file_list()
environment_from_file = compose_file.services["frontend"].env_file.readFile()

self.assertEqual(compose_file.services["frontend"].env_file, ['./sample/common.env', './sample/apps/web.env', './sample/opt/runtime_opts.env'])
self.assertEqual(compose_file.services["frontend"].env_file, ['./src/tests/sample/common.env', './src/tests/sample/apps/web.env', './src/tests/sample/opt/runtime_opts.env'])
self.assertEqual(environment_from_file["RACK_ENV"], "development")
self.assertEqual(environment_from_file["VAR"], '"quoted"')
self.assertEqual(environment_from_file["BAR"], "faz")
Expand Down
4 changes: 2 additions & 2 deletions src/tests/service/test_service_secret_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_service_with_single_secret(self):
secret_from_file = compose_file.secrets["my_secret"].file.readFile()

self.assertEqual(compose_file.services["frontend"].secrets[0].source, "my_secret")
self.assertEqual(compose_file.secrets["my_secret"].file, "./sample/my_secret.txt")
self.assertEqual(compose_file.secrets["my_secret"].file, "./src/tests/sample/my_secret.txt")
self.assertEqual(secret_from_file, secret_value)

def test_service_with_external_secret(self):
Expand All @@ -30,5 +30,5 @@ def test_service_with_long_syntax(self):
self.assertEqual(compose_file.services["frontend"].secrets[0].target, "redis_secret")
self.assertEqual(compose_file.services["frontend"].secrets[0].uid, 103)
self.assertEqual(compose_file.services["frontend"].secrets[0].gid, 103)
self.assertEqual(compose_file.secrets["my_secret"].file, "./sample/my_secret.txt")
self.assertEqual(compose_file.secrets["my_secret"].file, "./src/tests/sample/my_secret.txt")
self.assertEqual(secret_from_file, secret_value)