diff options
author | Ulysses Souza <ulyssessouza@gmail.com> | 2020-01-30 19:26:33 +0100 |
---|---|---|
committer | Ulysses Souza <ulyssessouza@gmail.com> | 2020-01-30 19:26:33 +0100 |
commit | 9f5f8b4757c449bde7c6ed733bf0f6f6bd2afe86 (patch) | |
tree | f3ab6f3a85fad7ca706221eef8dbfeb130d3b58f /tests | |
parent | 160b5c17551f0aef3f5d2c725964e07aba516442 (diff) |
Remove `None` entries on execute command
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/cli_test.py | 11 | ||||
-rw-r--r-- | tests/fixtures/exec-novalue-var/docker-compose.yml | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 7fa7fc54..43d5a3f5 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -1711,6 +1711,17 @@ services: assert stderr == "" assert stdout == "/\n" + @mock.patch.dict(os.environ) + def test_exec_novalue_var_dotenv_file(self): + os.environ['MYVAR'] = 'SUCCESS' + self.base_dir = 'tests/fixtures/exec-novalue-var' + self.dispatch(['up', '-d']) + assert len(self.project.containers()) == 1 + + stdout, stderr = self.dispatch(['exec', '-T', 'nginx', 'env']) + assert 'CHECK_VAR=SUCCESS' in stdout + assert not stderr + def test_exec_detach_long_form(self): self.base_dir = 'tests/fixtures/links-composefile' self.dispatch(['up', '--detach', 'console']) diff --git a/tests/fixtures/exec-novalue-var/docker-compose.yml b/tests/fixtures/exec-novalue-var/docker-compose.yml new file mode 100644 index 00000000..1f8502f9 --- /dev/null +++ b/tests/fixtures/exec-novalue-var/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + nginx: + image: nginx + environment: + - CHECK_VAR=${MYVAR} |