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
7f0407a1
Commit
7f0407a1
authored
2 years ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Tidy up test_json file.
parent
844e00c7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/comparators/test_json.py
+5
-7
5 additions, 7 deletions
tests/comparators/test_json.py
with
5 additions
and
7 deletions
tests/comparators/test_json.py
+
5
−
7
View file @
7f0407a1
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2016-2017, 2020 Chris Lamb <lamby@debian.org>
# Copyright © 2016-2017, 2020
, 2022
Chris Lamb <lamby@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
...
...
@@ -20,7 +20,7 @@ import pytest
from
diffoscope.comparators.json
import
JSONFile
from
..utils.data
import
load_fixture
,
get_data
from
..utils.data
import
load_fixture
,
assert_diff
from
..utils.nonexisting
import
assert_non_existing
...
...
@@ -49,9 +49,7 @@ def differences(json1, json2):
def
test_diff
(
differences
):
expected_diff
=
get_data
(
"
json_expected_diff
"
)
assert
differences
[
0
].
unified_diff
==
expected_diff
assert_diff
(
differences
[
0
],
"
json_expected_diff
"
)
def
test_compare_non_existing
(
monkeypatch
,
json1
):
...
...
@@ -60,5 +58,5 @@ def test_compare_non_existing(monkeypatch, json1):
def
test_ordering_differences
(
json3a
,
json3b
):
diff
=
json3a
.
compare
(
json3b
)
assert
diff
.
details
[
0
].
_
comments
==
[
"
Ordering differences only
"
]
assert
diff
.
details
[
0
]
.
unified_diff
==
get_data
(
"
order1.diff
"
)
assert
diff
.
details
[
0
].
comments
==
[
"
Ordering differences only
"
]
assert
_diff
(
diff
.
details
[
0
]
,
"
order1.diff
"
)
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