Handle both SIGINT and SIGTERM for docker-compose up.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
9f6a5a964a
commit
ea4230e7a2
3 changed files with 76 additions and 23 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue