def test_should_use_ref1_name_and_source_ext(self): source_file_list = ['file1.pdf'] ref_file_list = ['ref1.xy'] assert get_relative_output_file_list( source_file_list, output_filename_pattern='{ref.name}{ext}', file_lists={ 'ref': ref_file_list } ) == ['ref1.pdf']
def test_should_use_source_relative_subdirectory_if_in_pattern(self): source_file_list = ['sub/file1.pdf'] assert get_relative_output_file_list( source_file_list, output_filename_pattern='{dir}{filename}' ) == ['sub/file1.pdf']
def test_should_use_index_and_source_ext(self): source_file_list = ['file1.pdf'] assert get_relative_output_file_list( source_file_list, output_filename_pattern='index-{index}{ext}' ) == ['index-0.pdf']
def test_should_strip_gz_from_name_and_ext(self): source_file_list = ['file1.pdf.gz'] assert get_relative_output_file_list( source_file_list, output_filename_pattern='{name}-suffix{ext}' ) == ['file1-suffix.pdf']
def test_should_use_name(self): source_file_list = ['file1.pdf'] assert get_relative_output_file_list( source_file_list, output_filename_pattern='{name}-suffix{ext}' ) == ['file1-suffix.pdf']
def test_should_return_empty_list_if_source_file_list_is_empty(self): assert get_relative_output_file_list( [], output_filename_pattern='' ) == []