def test_should_allow_grobid_only_with_pdf_file_list(self):
   parse_args([
     '--data-path=' + BASE_DATA_PATH,
     '--pdf-file-list=' + FILE_LIST_PATH,
     '--pdf-file-column=' + FILE_COLUMN,
     '--use-grobid'
   ])
 def test_should_require_crf_or_cv_model_with_pdf_file_list(self):
   with pytest.raises(SystemExit):
     parse_args([
       '--data-path=' + BASE_DATA_PATH,
       '--pdf-file-list=' + FILE_LIST_PATH,
       '--pdf-file-column=' + FILE_COLUMN
     ])
 def test_should_allow_cv_model_only_with_pdf_file_list(self):
   parse_args([
     '--data-path=' + BASE_DATA_PATH,
     '--pdf-file-list=' + FILE_LIST_PATH,
     '--pdf-file-column=' + FILE_COLUMN,
     '--cv-model-export-dir=' + CV_MODEL_EXPORT_DIR
   ])
 def test_should_not_allow_cv_model_with_lxml_file_list(self):
   with pytest.raises(SystemExit):
     parse_args([
       '--data-path=' + BASE_DATA_PATH,
       '--lxml-file-list=' + FILE_LIST_PATH,
       '--lxml-file-column=' + FILE_COLUMN,
       '--cv-model-export-dir=' + CV_MODEL_EXPORT_DIR
     ])
 def test_should_allow_pdf_path_to_be_specified(self):
   args = parse_args([
     '--data-path=' + BASE_DATA_PATH,
     '--pdf-path=' + PDF_PATH,
     '--crf-model=' + MODEL_EXPORT_DIR
   ])
   assert args.pdf_path == PDF_PATH
 def test_should_allow_lxml_file_list_and_column_to_be_specified(self):
   args = parse_args([
     '--data-path=' + BASE_DATA_PATH,
     '--lxml-file-list=' + FILE_LIST_PATH,
     '--lxml-file-column=' + FILE_COLUMN
   ])
   assert args.lxml_file_list == FILE_LIST_PATH
   assert args.lxml_file_column == FILE_COLUMN
 def test_should_allow_pdf_file_list_and_column_to_be_specified(self):
   args = parse_args([
     '--data-path=' + BASE_DATA_PATH,
     '--pdf-file-list=' + FILE_LIST_PATH,
     '--pdf-file-column=' + FILE_COLUMN,
     '--crf-model=' + MODEL_EXPORT_DIR
   ])
   assert args.pdf_file_list == FILE_LIST_PATH
   assert args.pdf_file_column == FILE_COLUMN
def get_default_args():
  return parse_args(MIN_ARGV)
 def test_should_require_crf_or_cv_model_with_pdf_path(self):
   with pytest.raises(SystemExit):
     parse_args([
       '--data-path=' + BASE_DATA_PATH,
       '--pdf-path=' + PDF_PATH
     ])
 def test_should_raise_error_if_no_source_argument_was_provided(self):
   with pytest.raises(SystemExit):
     parse_args([
       '--data-path=' + BASE_DATA_PATH,
       '--crf-model=' + MODEL_EXPORT_DIR
     ])
 def test_should_parse_minimum_number_of_arguments(self):
   parse_args(MIN_ARGV)