mirror of https://github.com/docker/compose.git
Remove environment-overriding unit test for 'run'
There's already an acceptance test for it Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
575b48749d
commit
4644f2c0f9
|
@ -110,39 +110,6 @@ class CLITestCase(unittest.TestCase):
|
|||
_, _, call_kwargs = mock_run_operation.mock_calls[0]
|
||||
assert call_kwargs['logs'] is False
|
||||
|
||||
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
||||
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
||||
def test_run_with_environment_merged_with_options_list(self, mock_pseudo_terminal):
|
||||
command = TopLevelCommand()
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
mock_project = mock.Mock(client=mock_client)
|
||||
mock_project.get_service.return_value = Service(
|
||||
'service',
|
||||
client=mock_client,
|
||||
environment=['FOO=ONE', 'BAR=TWO'],
|
||||
image='someimage')
|
||||
|
||||
command.run(mock_project, {
|
||||
'SERVICE': 'service',
|
||||
'COMMAND': None,
|
||||
'-e': ['BAR=NEW', 'OTHER=bär'.encode('utf-8')],
|
||||
'--user': None,
|
||||
'--no-deps': None,
|
||||
'-d': True,
|
||||
'-T': None,
|
||||
'--entrypoint': None,
|
||||
'--service-ports': None,
|
||||
'--publish': [],
|
||||
'--rm': None,
|
||||
'--name': None,
|
||||
})
|
||||
|
||||
_, _, call_kwargs = mock_client.create_container.mock_calls[0]
|
||||
assert (
|
||||
sorted(call_kwargs['environment']) ==
|
||||
sorted(['FOO=ONE', 'BAR=NEW', 'OTHER=bär'])
|
||||
)
|
||||
|
||||
def test_run_service_with_restart_always(self):
|
||||
command = TopLevelCommand()
|
||||
mock_client = mock.create_autospec(docker.Client)
|
||||
|
|
Loading…
Reference in New Issue