コード例 #1
0
    def test_call_without_optional_input_args(self, mocker, mocks_init_class,
                                              test_data):
        mock_run = mocker.patch.object(ProcessAPI, "run")

        process('some_dataset')

        assert_mock_init_class(mocks_init_class)
        assert mock_run.called
コード例 #2
0
    def test_call_with_all_input_args(self, mocker, mocks_init_class,
                                      test_data):
        mock_run = mocker.patch.object(ProcessAPI, "run")

        process(test_data["dataset"], test_data["task"], test_data["verbose"])

        assert_mock_init_class(mocks_init_class)
        assert mock_run.called
コード例 #3
0
 def test_call__raises_error_too_many_args(self, mocker):
     with pytest.raises(TypeError):
         process('some_dataset', 'some_task', True, 'extra_field')
コード例 #4
0
 def test_call__raises_error_no_inputs(self, mocker):
     with pytest.raises(TypeError):
         process()