def test_src_as_files_single_dir(self): """Test src_as_files single directory passed.""" src_dir = os.path.join(TEST_ROOT, '_sample') src = [src_dir] output = list(utils.src_as_files(src)) expencted_output = [os.path.join(TEST_ROOT, '_sample', 'pdf1.pdf')] self.assertEqual(output, expencted_output)
def test_src_as_files_list_of_files(self): """Test src_as_files with a list of Pdf argument.""" pdf1 = os.path.join(TEST_ROOT, '_sample', 'pdf1.pdf') pdf2 = os.path.join(TEST_ROOT, '_sample', 'subdir', 'pdf2.pdf') src = [pdf1, pdf2] output = list(utils.src_as_files(src)) expencted_output = [pdf1, pdf2] self.assertEqual(output, expencted_output)
def test_src_as_files_files_and_dirs(self): """Test src_as_files with a both files and directory arguments.""" src_dir1 = os.path.join(TEST_ROOT, '_sample') src_dir2 = os.path.join(TEST_ROOT, '_sample', 'subdir') src = [src_dir1, src_dir2] pdf1 = os.path.join(TEST_ROOT, '_sample', 'pdf1.pdf') pdf2 = os.path.join(TEST_ROOT, '_sample', 'subdir', 'pdf2.pdf') output = list(utils.src_as_files(src)) expencted_output = [pdf1, pdf2] self.assertEqual(output, expencted_output)
def test_src_as_files_single_file(self): """Test src_as_files with a single Pdf argument.""" src = [os.path.join(TEST_ROOT, '_sample', 'pdf1.pdf')] output = list(utils.src_as_files(src)) expencted_output = [os.path.join(TEST_ROOT, '_sample', 'pdf1.pdf')] self.assertEqual(output, expencted_output)