[diffoscope] 05/05: comparators.xml: Fix EPUB "missing file" tests; they ship a META-INF/container.xml file.

Chris Lamb chris at chris-lamb.co.uk
Fri Jul 21 11:43:56 CEST 2017


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

lamby pushed a commit to branch master
in repository diffoscope.

commit 2422e0f0f8a8ae66da0438f9fc64376faa154b53
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Jul 21 10:42:21 2017 +0100

    comparators.xml: Fix EPUB "missing file" tests; they ship a META-INF/container.xml file.
---
 diffoscope/comparators/xml.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/diffoscope/comparators/xml.py b/diffoscope/comparators/xml.py
index bb6177c..2e657cc 100644
--- a/diffoscope/comparators/xml.py
+++ b/diffoscope/comparators/xml.py
@@ -25,6 +25,8 @@ from xml.parsers.expat import ExpatError
 from diffoscope.difference import Difference
 from diffoscope.comparators.utils.file import File
 
+from .missing_file import MissingFile
+
 
 def _format(node):
     """
@@ -103,6 +105,14 @@ class XMLFile(File):
         Returns:
             A diffoscope.difference.Difference object
         """
+        if isinstance(other, MissingFile):
+            return [Difference(
+                None,
+                self.name,
+                other.name,
+                comment="Trying to compare two non-existing files."
+            )]
+
         return [Difference.from_text(
             self.dumps(self),
             self.dumps(other),

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


More information about the diffoscope mailing list