[diffoscope] 02/03: Test that external tools providers are being returned when tool is not found.

Maria Glukhova siamezzze-guest at moszumanska.debian.org
Sun May 7 16:14:36 CEST 2017


This is an automated email from the git hooks/post-receive script.

siamezzze-guest pushed a commit to branch experimental
in repository diffoscope.

commit e9744c6ab9ae2c260310551363767864920ada06
Author: Maria Glukhova <siamezzze at gmail.com>
Date:   Sun May 7 15:06:37 2017 +0300

    Test that external tools providers are being returned when tool is not found.
    
    Modify test_with_compare_details_and_tool_not_found to actually test get_package().
---
 tests/comparators/test_binary.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/comparators/test_binary.py b/tests/comparators/test_binary.py
index 3a0e90d..64602ef 100644
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -136,7 +136,17 @@ def test_with_compare_details_and_failed_process():
 
 @skip_unless_tools_exist('xxd')
 def test_with_compare_details_and_tool_not_found(monkeypatch):
-    monkeypatch.setattr('diffoscope.exc.RequiredToolNotFound.get_package', lambda _: 'some-package')
+    from diffoscope.external_tools import EXTERNAL_TOOLS
+    monkeypatch.setitem(
+        EXTERNAL_TOOLS,
+        'nonexistent',
+        {
+            'debian': 'some-package',
+            'arch': 'some-package',
+            'Fedora': 'some-package',
+            'FreeBSD': 'some-package'
+        }
+    )
     class MockFile(FilesystemFile):
         @tool_required('nonexistent')
         def compare_details(self, other, source=None):

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


More information about the diffoscope mailing list