From faae8466ac51b22a9b836103ce6e5c039dfc7eea Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 17 Dec 2013 20:17:17 +0000 Subject: Add --output-dir option --- tests/cli_tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') 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"""

""", 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("""

""", output_file.read()) -- cgit v1.2.3