コード例 #1
0
ファイル: main_test.py プロジェクト: nhumrich/compose
    def test_attach_to_logs(self):
        project = mock.create_autospec(Project)
        log_printer = mock.create_autospec(LogPrinter, containers=[])
        service_names = ["web", "db"]
        timeout = 12

        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)
        log_printer.run.assert_called_once_with()
        project.stop.assert_called_once_with(service_names=service_names, timeout=timeout)
コード例 #2
0
ファイル: main_test.py プロジェクト: oeuftete/compose
    def test_attach_to_logs(self):
        project = mock.create_autospec(Project)
        log_printer = mock.create_autospec(LogPrinter, containers=[])
        service_names = ['web', 'db']
        timeout = 12

        with mock.patch('compose.cli.main.signal', autospec=True) as mock_signal:
            attach_to_logs(project, log_printer, service_names, timeout)

        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()
コード例 #3
0
ファイル: main_test.py プロジェクト: predakanga/compose
    def test_attach_to_logs(self):
        project = mock.create_autospec(Project)
        log_printer = mock.create_autospec(LogPrinter, containers=[])
        service_names = ['web', 'db']
        timeout = 12

        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)
        log_printer.run.assert_called_once_with()
        project.stop.assert_called_once_with(
            service_names=service_names,
            timeout=timeout)