Handle both SIGINT and SIGTERM for docker-compose up.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2015-11-10 18:52:21 -05:00
commit ea4230e7a2
3 changed files with 76 additions and 23 deletions

View file

@ -57,11 +57,11 @@ class CLIMainTestCase(unittest.TestCase):
with mock.patch('compose.cli.main.signal', autospec=True) as mock_signal:
attach_to_logs(project, log_printer, service_names, timeout)
mock_signal.signal.assert_called_once_with(mock_signal.SIGINT, mock.ANY)
assert mock_signal.signal.mock_calls == [
mock.call(mock_signal.SIGINT, mock.ANY),
mock.call(mock_signal.SIGTERM, mock.ANY),
]
log_printer.run.assert_called_once_with()
project.stop.assert_called_once_with(
service_names=service_names,
timeout=timeout)
class SetupConsoleHandlerTestCase(unittest.TestCase):