aboutsummaryrefslogtreecommitdiff
path: root/tests/cli_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cli_tests.py')
-rw-r--r--tests/cli_tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/cli_tests.py b/tests/cli_tests.py
index c274ce2..b23ae9a 100644
--- a/tests/cli_tests.py
+++ b/tests/cli_tests.py
@@ -34,4 +34,16 @@ def inline_images_are_included_in_output_if_writing_to_single_file():
docx_path = test_path("tiny-picture.docx")
result = _local.run(["mammoth", docx_path])
assert_equal(b"""<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOvgAADr4B6kKxwAAAABNJREFUKFNj/M+ADzDhlWUYqdIAQSwBE8U+X40AAAAASUVORK5CYII=" /></p>""", result.output)
+
+
+@istest
+def images_are_written_to_separate_files_if_output_dir_is_set():
+ with tempman.create_temp_dir() as temp_dir:
+ output_path = os.path.join(temp_dir.path, "tiny-picture.html")
+ docx_path = test_path("tiny-picture.docx")
+ result = _local.run(["mammoth", docx_path, "--output-dir", temp_dir.path])
+ assert_equal(b"", result.stderr_output)
+ assert_equal(b"", result.output)
+ with open(output_path) as output_file:
+ assert_equal("""<p><img src="1.png" /></p>""", output_file.read())