Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
tests/comparators/test_binary.py: Update tests after copy change.
· e427e0ce
Chris Lamb
authored
May 21, 2018
e427e0ce
Don't append rather useless "(data)" suffix.
· 59b41a23
Chris Lamb
authored
May 21, 2018
59b41a23
Hide whitespace changes
Inline
Side-by-side
diffoscope/comparators/utils/file.py
View file @
59b41a23
...
...
@@ -369,11 +369,11 @@ class File(object, metaclass=abc.ABCMeta):
difference
=
self
.
compare_bytes
(
other
,
source
=
source
)
if
difference
is
None
:
return
None
suffix
=
'
({})
'
.
format
(
self
.
magic_file_type
)
\
if
self
.
magic_file_type
!=
'
data
'
difference
.
add_comment
(
"
Format-specific differences are supported for this
"
"
file format but none were detected ({})
"
.
format
(
self
.
magic_file_type
,
),
"
file format but none were detected{}
"
.
format
(
suffix
))
)
except
subprocess
.
CalledProcessError
as
e
:
difference
=
self
.
compare_bytes
(
other
,
source
=
source
)
...
...
tests/comparators/test_binary.py
View file @
59b41a23
...
...
@@ -128,7 +128,7 @@ def test_with_compare_details_and_fallback():
return
[]
difference
=
MockFile
(
TEST_FILE1_PATH
).
compare
(
MockFile
(
TEST_FILE2_PATH
))
expected_diff
=
get_data
(
'
binary_expected_diff
'
)
assert
'
yet data differs
'
in
difference
.
comment
assert
'
but none were detected
'
in
difference
.
comment
assert
normalize_zeros
(
difference
.
unified_diff
)
==
expected_diff
...
...