def test_should_raise_error_if_image_height_was_specified_without_image_width(
         self):
     with pytest.raises(SystemExit):
         parse_args([
             '--data-path=test', '--pdf-path=test', '--xml-path=test',
             '--save-png', '--image-height=100'
         ])
 def test_should_raise_error_if_save_tfrecords_specified_without_pdf_path(
         self):
     with pytest.raises(SystemExit):
         parse_args([
             '--data-path=test', '--lxml-path=test', '--xml-path=test',
             '--save-tfrecords'
         ])
def get_default_args():
    return parse_args([
        '--data-path=' + BASE_DATA_PATH, '--pdf-path=' + PDF_PATH,
        '--xml-path=' + XML_PATH, '--save-svg'
    ])
 def test_should_parse_pages_as_list(self):
     assert parse_args(MIN_ARGV + ['--pages=1-3']).pages == (1, 3)
 def test_should_have_none_page_range_by_default(self):
     assert parse_args(MIN_ARGV).pages is None
 def test_should_not_raise_error_if_save_tfrecords_specified_with_pdf_xml_file_list(
         self):
     parse_args([
         '--data-path=test', '--pdf-xml-file-list=test', '--xml-path=test',
         '--save-tfrecords'
     ])
 def test_should_not_raise_error_if_both_image_width_and_height_are_specified(
         self):
     parse_args([
         '--data-path=test', '--pdf-path=test', '--xml-path=test',
         '--save-png', '--image-width=100', '--image-height=100'
     ])
 def test_should_not_raise_error_with_save_png_path_together_with_pdf_xml_file_list(
         self):
     parse_args([
         '--data-path=test', '--pdf-xml-file-list=test', '--save-png',
         '--xml-path=test'
     ])
 def test_should_not_raise_error_if_pdf_xml_file_list_specified_without_xml_path(
         self):
     parse_args(
         ['--data-path=test', '--pdf-xml-file-list=test', '--save-svg'])
 def test_should_not_raise_error_with_save_lxml_path_together_with_pdf_path(
         self):
     parse_args([
         '--data-path=test', '--pdf-path=test', '--save-lxml',
         '--xml-path=test'
     ])
 def test_should_raise_error_if_pdf_path_specified_without_xml_path(self):
     with pytest.raises(SystemExit):
         parse_args(['--data-path=test', '--pdf-path=test', '--save-svg'])
 def test_should_raise_error_if_no_output_option_specified(self):
     with pytest.raises(SystemExit):
         parse_args(
             ['--data-path=test', '--pdf-path=test', '--xml-path=test'])
 def test_should_not_raise_error_with_lxml_path_instead_of_pdf_path(self):
     parse_args([
         '--data-path=test', '--lxml-path=test', '--xml-path=test',
         '--save-svg'
     ])
 def test_should_not_raise_error_with_minimum_arguments(self):
     parse_args([
         '--data-path=test', '--pdf-path=test', '--xml-path=test',
         '--save-svg'
     ])
 def test_should_raise_error_without_arguments(self):
     with pytest.raises(SystemExit):
         parse_args([])