Exemplo n.º 1
0
    def test_cli_with_mode(self, mock_post: MagicMock,
                           mock_identity_token: MagicMock):

        apply_mock_behaviour(mock_post=mock_post,
                             mock_identity_token=mock_identity_token)
        main_from_args(['analysis-runner', *self.ANALYSIS_RUNNER_ARGS])

        mock_post.assert_called()
        mock_identity_token.assert_called()
Exemplo n.º 2
0
    def test_regular_cli(self, mock_post: MagicMock,
                         mock_identity_token: MagicMock):

        apply_mock_behaviour(mock_post=mock_post,
                             mock_identity_token=mock_identity_token)

        main_from_args(self.ANALYSIS_RUNNER_ARGS)

        mock_post.assert_called()
        mock_identity_token.assert_called()
Exemplo n.º 3
0
    def test_status_cli(self, mock_print: MagicMock, mock_get: MagicMock,
                        mock_id_token):

        apply_mock_behaviour(mock_identity_token=mock_id_token)
        cm = {
            'id': '<mocked-id>',
            'start': '2021-07-09T09:47:00.000Z',
            'end': '2021-07-09T09:48:00.000Z',
            'calls': {
                'wf.print': [{
                    'name': 'print',
                    'executionStatus': 'succeeded',
                    'start': '2021-07-09T09:47:00.000Z',
                    'end': '2021-07-09T09:48:00.000Z',
                }]
            },
        }
        mock_get.return_value = MockResponse(json=lambda: cm)

        args = ['cromwell', 'status', '<mocked-id>', '--monochrome']

        status_str = """
-----------  ------------------------
Workflow ID  <mocked-id>
Name
Status       preparing
Start        2021-07-09T09:47:00.000Z
End          2021-07-09T09:48:00.000Z
Duration     1m:0s
-----------  ------------------------
Jobs:
  [#] print (1m:0s)
"""

        main_from_args(args)

        mock_get.assert_called()
        mock_print.assert_called_with(status_str)
Exemplo n.º 4
0
    def test_submit_cli(self, mock_post: MagicMock,
                        mock_identity_token: MagicMock):
        apply_mock_behaviour(mock_post=mock_post,
                             mock_identity_token=mock_identity_token)

        args = [
            'cromwell',
            'submit',
            '--dataset',
            'fewgenomes',
            '--access-level',
            'test',
            '--description',
            'mock-test',
            '--output-dir',
            'hello-world-test',
            'workflow.wdl',
        ]

        main_from_args(args)

        mock_post.assert_called()
        mock_identity_token.assert_called()
Exemplo n.º 5
0
 def test_help_full(self, mock_print: MagicMock):
     main_from_args(['--help'])
     mock_print.assert_called()
Exemplo n.º 6
0
 def test_help_short(self, mock_print: MagicMock):
     main_from_args(['-h'])
     mock_print.assert_called()
Exemplo n.º 7
0
 def test_version_full(self, mock_print: MagicMock):
     main_from_args(['--version'])
     mock_print.assert_called_with(VERSION_STR)