[diffoscope] 02/04: tests: Smoke test --progress output.

Chris Lamb chris at chris-lamb.co.uk
Sun Feb 5 03:44: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 909522522898055c9ec655f635c570097972d3ef
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Feb 5 15:40:14 2017 +1300

    tests: Smoke test --progress output.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 tests/test_progress.py | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/test_progress.py b/tests/test_progress.py
new file mode 100644
index 0000000..08cc9c6
--- /dev/null
+++ b/tests/test_progress.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+#
+# diffoscope: in-depth comparison of files, archives, and directories
+#
+# Copyright © 2017 Chris Lamb <lamby at debian.org>
+#
+# diffoscope is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# diffoscope is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import pytest
+
+from diffoscope.main import main
+
+TEST_TAR1_PATH = os.path.join(os.path.dirname(__file__), 'data', 'test1.tar')
+TEST_TAR2_PATH = os.path.join(os.path.dirname(__file__), 'data', 'test2.tar')
+
+
+def run(capsys, *args):
+    with pytest.raises(SystemExit) as exc:
+        main(args)
+
+    out, err = capsys.readouterr()
+
+    return exc.value.code, out, err
+
+def test_progress(capsys):
+    ret, _, err = run(capsys, TEST_TAR1_PATH, TEST_TAR2_PATH, '--progress')
+
+    assert ret == 1
+    assert "ETA" in err

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list