[diffoscope] 03/03: Test --html-dir option.
Chris Lamb
chris at chris-lamb.co.uk
Mon Jan 16 06:38:58 CET 2017
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit 633eb40a8caecea5ac9bfbf35876c03a063a3638
Author: Chris Lamb <lamby at debian.org>
Date: Mon Jan 16 16:19:03 2017 +1100
Test --html-dir option.
---
tests/test_main.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tests/test_main.py b/tests/test_main.py
index bed24a6..c7f55b3 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -136,6 +136,19 @@ def test_html_option_with_file(tmpdir, capsys):
with open(report_path, 'r', encoding='utf-8') as f:
assert 'meta name="generator" content="diffoscope"' in f.read()
+def test_htmldir_option(tmpdir, capsys):
+ html_dir = os.path.join(str(tmpdir), 'target')
+ args = ['--html-dir', html_dir, TEST_TAR1_PATH, TEST_TAR2_PATH]
+ with pytest.raises(SystemExit) as excinfo:
+ main(args)
+ assert excinfo.value.code == 1
+ out, err = capsys.readouterr()
+ assert err == ''
+ assert out == ''
+ assert os.path.isdir(html_dir)
+ with open(os.path.join(html_dir, 'index.html'), 'r', encoding='utf-8') as f:
+ assert 'meta name="generator" content="diffoscope"' in f.read()
+
def test_html_option_with_stdout(capsys):
args = ['--html', '-', TEST_TAR1_PATH, TEST_TAR2_PATH]
with pytest.raises(SystemExit) as excinfo:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list