mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Add test cases for bulk document conversion
This commit is contained in:
parent
f9b564be03
commit
e17912888a
1 changed files with 23 additions and 0 deletions
|
@ -214,6 +214,29 @@ class TestCliConversion(TestCliBasic):
|
|||
result.assert_success()
|
||||
assert len(os.listdir(tmp_path)) == 2
|
||||
|
||||
def test_bulk(self, tmp_path: Path) -> None:
|
||||
filenames = ["1.pdf", "2.pdf", "3.pdf"]
|
||||
file_paths = []
|
||||
for filename in filenames:
|
||||
doc_path = str(tmp_path / filename)
|
||||
shutil.copyfile(self.sample_doc, doc_path)
|
||||
file_paths.append(doc_path)
|
||||
|
||||
result = self.run_cli(file_paths)
|
||||
result.assert_success()
|
||||
assert len(os.listdir(tmp_path)) == 2 * len(filenames)
|
||||
|
||||
def test_bulk_fail_on_output_filename(self, tmp_path: Path) -> None:
|
||||
filenames = ["1.pdf", "2.pdf", "3.pdf"]
|
||||
file_paths = []
|
||||
for filename in filenames:
|
||||
doc_path = str(tmp_path / filename)
|
||||
shutil.copyfile(self.sample_doc, doc_path)
|
||||
file_paths.append(doc_path)
|
||||
|
||||
result = self.run_cli(['--output-filename="output.pdf"'] + file_paths)
|
||||
result.assert_failure()
|
||||
|
||||
|
||||
class TestSecurity(TestCli):
|
||||
def test_suspicious_double_dash_file(self, tmp_path: Path) -> None:
|
||||
|
|
Loading…
Reference in a new issue