Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
647eb03f
Commit
647eb03f
authored
3 years ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Update .epub test data methodology after improving XML file parsing.
parent
17db8fe0
No related branches found
Branches containing commit
Tags
215
Tags containing commit
No related merge requests found
Pipeline
#312927
canceled
3 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/comparators/test_epub.py
+12
-2
12 additions, 2 deletions
tests/comparators/test_epub.py
tests/data/epub_expected_diffs
+28
-26
28 additions, 26 deletions
tests/data/epub_expected_diffs
with
40 additions
and
28 deletions
tests/comparators/test_epub.py
+
12
−
2
View file @
647eb03f
...
...
@@ -55,8 +55,18 @@ def test_differences(differences):
assert
differences
[
2
].
source2
==
"
toc.ncx
"
assert
differences
[
3
].
source1
==
"
ch001.xhtml
"
assert
differences
[
3
].
source2
==
"
ch001.xhtml
"
expected_diff
=
get_data
(
"
epub_expected_diffs
"
)
assert
expected_diff
==
""
.
join
(
map
(
lambda
x
:
x
.
unified_diff
,
differences
))
# Flatten everything recursively, as XMLFile will contain reformatted data
# under Difference.details.
def
fn
(
difference
):
if
difference
.
unified_diff
:
yield
difference
.
unified_diff
for
x
in
difference
.
details
:
yield
from
fn
(
x
)
val
=
"
\n
"
.
join
(
"
\n
"
.
join
(
fn
(
x
))
for
x
in
differences
)
assert
val
==
get_data
(
"
epub_expected_diffs
"
)
@skip_unless_tools_exist
(
"
zipinfo
"
)
...
...
This diff is collapsed.
Click to expand it.
tests/data/epub_expected_diffs
+
28
−
26
View file @
647eb03f
...
...
@@ -21,9 +21,10 @@
+-rw---- 0.0 fat 655 b- defX 15-Oct-27 11:33 nav.xhtml
+-rw---- 0.0 fat 615 b- defX 15-Oct-27 11:33 ch001.xhtml
+9 files, 4535 bytes uncompressed, 2325 bytes compressed: 48.7%
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="
UTF
-8"?>
<package
version="2.0"
xmlns="http://www.idpf.org/2007/opf" unique-identifier="epub-id-1">
<?xml version="1.0" encoding="
utf
-8"?>
<package xmlns="http://www.idpf.org/2007/opf"
version="2.0"
unique-identifier="epub-id-1">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
- <dc:identifier id="epub-id-1">urn:uuid:488fe0b5-29d9-4d64-a023-ca08947d78ae</dc:identifier>
+ <dc:identifier id="epub-id-1">urn:uuid:c3082605-195c-4273-acad-528beceba843</dc:identifier>
...
...
@@ -33,34 +34,35 @@
<dc:language>en-US</dc:language>
</metadata>
<manifest>
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
<item id="style" href="stylesheet.css" media-type="text/css" />
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" />
<item id="title_page_xhtml" href="title_page.xhtml" media-type="application/xhtml+xml" />
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
<item id="style" href="stylesheet.css" media-type="text/css"/>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml"/>
<item id="title_page_xhtml" href="title_page.xhtml" media-type="application/xhtml+xml"/>
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="
UTF
-8"?>
<ncx
version="2005-1"
xmlns="http://www.daisy.org/z3986/2005/ncx/">
<?xml version="1.0" encoding="
utf
-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/"
version="2005-1"
>
<head>
- <meta name="dtb:uid" content="urn:uuid:488fe0b5-29d9-4d64-a023-ca08947d78ae"
/>
+ <meta name="dtb:uid" content="urn:uuid:c3082605-195c-4273-acad-528beceba843"
/>
<meta name="dtb:depth" content="1"
/>
<meta name="dtb:totalPageCount" content="0"
/>
<meta name="dtb:maxPageNumber" content="0"
/>
- <meta name="dtb:uid" content="urn:uuid:488fe0b5-29d9-4d64-a023-ca08947d78ae"/>
+ <meta name="dtb:uid" content="urn:uuid:c3082605-195c-4273-acad-528beceba843"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
</head>
<docTitle>
<text>Test Ebook</text>
</docTitle>
@@ -8,12 +8,12 @@
<title>Test Ebook</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<div id="test-ebook" class="section level1 unnumbered">
<h1>Test Ebook</h1>
<p>Hello World!</p>
-<p>Time: 12:32</p>
+<p>Time: 12:33</p>
</div>
</body>
@@ -10,11 +10,11 @@
<title>Test Ebook</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"/>
</head>
<body>
<div id="test-ebook" class="section level1 unnumbered">
<h1>Test Ebook</h1>
<p>Hello World!</p>
- <p>Time: 12:32</p>
+ <p>Time: 12:33</p>
</div>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment