Esempio n. 1
0
 def test_should_allow_source_file_list_and_column_to_be_specified(
         self, pipeline, app_config):
     args = parse_args(pipeline, app_config, [
         '--data-path=' + BASE_DATA_PATH, '--source-file-list=' +
         FILE_LIST_PATH, '--source-file-column=' + FILE_COLUMN
     ])
     assert args.source_file_list == FILE_LIST_PATH
     assert args.source_file_column == FILE_COLUMN
Esempio n. 2
0
 def test_should_parse_pipeline_args(self, pipeline, app_config):
     pipeline.add_arguments.side_effect = _add_test_args
     args = parse_args(pipeline, app_config, [
         '--data-path=' + BASE_DATA_PATH, '--source-file-list=' +
         FILE_LIST_PATH, '--source-file-column=' + FILE_COLUMN,
         '--pipeline=test', '--test-arg=123'
     ])
     assert args.test_arg == '123'
Esempio n. 3
0
def get_default_args(app_config):
    opt = parse_args(MagicMock(), app_config, MIN_ARGV)
    opt.base_data_path = BASE_DATA_PATH
    opt.output_path = OUTPUT_PATH
    opt.output_suffix = OUTPUT_SUFFIX
    return opt
Esempio n. 4
0
 def test_should_call_pipeline_add_arguments(self, pipeline, app_config):
     parse_args(pipeline, app_config, MIN_ARGV)
     pipeline.add_arguments.assert_called_with(ANY, app_config, MIN_ARGV)
Esempio n. 5
0
 def test_should_allow_source_path_to_be_specified(self, pipeline,
                                                   app_config):
     args = parse_args(
         pipeline, app_config,
         ['--data-path=' + BASE_DATA_PATH, '--source-path=' + PDF_PATH])
     assert args.source_path == PDF_PATH
Esempio n. 6
0
 def test_should_raise_error_if_no_source_argument_was_provided(
         self, pipeline, app_config):
     with pytest.raises(SystemExit):
         parse_args(pipeline, app_config, ['--data-path=' + BASE_DATA_PATH])
Esempio n. 7
0
 def test_should_not_resume_by_default(self, pipeline, app_config):
     args = parse_args(pipeline, app_config, MIN_ARGV)
     assert not args.resume
Esempio n. 8
0
 def test_should_parse_minimum_number_of_arguments(self, pipeline,
                                                   app_config):
     parse_args(pipeline, app_config, MIN_ARGV)