mirror of
https://github.com/docker/compose.git
synced 2025-07-21 20:54:32 +02:00
Add test for logs=False
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com> Conflicts: compose/cli/main.py
This commit is contained in:
parent
833e16117e
commit
d399b7893f
@ -71,6 +71,37 @@ class CLITestCase(unittest.TestCase):
|
|||||||
with self.assertRaises(NoSuchCommand):
|
with self.assertRaises(NoSuchCommand):
|
||||||
TopLevelCommand().dispatch(['help', 'nonexistent'], None)
|
TopLevelCommand().dispatch(['help', 'nonexistent'], None)
|
||||||
|
|
||||||
|
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
||||||
|
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
||||||
|
def test_run_interactive_passes_logs_false(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')
|
||||||
|
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
command.run(mock_project, {
|
||||||
|
'SERVICE': 'service',
|
||||||
|
'COMMAND': None,
|
||||||
|
'-e': ['BAR=NEW', 'OTHER=bär'.encode('utf-8')],
|
||||||
|
'--user': None,
|
||||||
|
'--no-deps': None,
|
||||||
|
'-d': False,
|
||||||
|
'-T': None,
|
||||||
|
'--entrypoint': None,
|
||||||
|
'--service-ports': None,
|
||||||
|
'--publish': [],
|
||||||
|
'--rm': None,
|
||||||
|
'--name': None,
|
||||||
|
})
|
||||||
|
|
||||||
|
_, _, call_kwargs = mock_pseudo_terminal.mock_calls[0]
|
||||||
|
assert call_kwargs['logs'] is False
|
||||||
|
|
||||||
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
@pytest.mark.xfail(IS_WINDOWS_PLATFORM, reason="requires dockerpty")
|
||||||
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
@mock.patch('compose.cli.main.PseudoTerminal', autospec=True)
|
||||||
def test_run_with_environment_merged_with_options_list(self, mock_pseudo_terminal):
|
def test_run_with_environment_merged_with_options_list(self, mock_pseudo_terminal):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user