From feb46b29ceb3ba25cee9711729b9c7af4abe8fa0 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Oct 25 2016 08:47:49 +0000 Subject: [PATCH 1/2] Shorten verbose log The verbose log is really verbose. This patch hides some of the less useful output behind a command line flag `--full`. Fixes: #32 Signed-off-by: Lubomír Sedlář --- diff --git a/MANIFEST.in b/MANIFEST.in index 387f238..3506e26 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,4 +11,5 @@ recursive-include tests/composes/*/compose/metadata *.json recursive-include tests/composes *.rpm *.composeinfo include tests/*.py include tests/move-report.json +recursive-include tests/fixtures *.json *.txt include doc/*.1 diff --git a/bin/compose-changelog b/bin/compose-changelog index 883b2bc..f483242 100755 --- a/bin/compose-changelog +++ b/bin/compose-changelog @@ -29,7 +29,7 @@ def run(opts): name = opts.name or new_compose.info.compose.id - changelog.write(data, path=opts.path, name=name) + changelog.write(data, path=opts.path, name=name, verbose=opts.full) if __name__ == '__main__': @@ -42,5 +42,9 @@ if __name__ == '__main__': parser.add_argument('-n', '--name', help='Identifier to be included in generated filenames. ' 'Defaults to compose id of new compose.') + parser.add_argument('--full', + action='store_true', + default=False, + help='Print all information about about packages.') opts = parser.parse_args() run(opts) diff --git a/compose_utils/changelog.py b/compose_utils/changelog.py index 8ad0afb..6ffd521 100644 --- a/compose_utils/changelog.py +++ b/compose_utils/changelog.py @@ -429,7 +429,7 @@ class ComposeChangelog(object): return "\n".join(result) - def get_verbose_log(self, changelog_data): + def get_verbose_log(self, changelog_data, shorten=False): result = [] result.append("OLD: %s" % changelog_data["old_compose"]) result.append("NEW: %s" % changelog_data["new_compose"]) @@ -453,7 +453,8 @@ class ComposeChangelog(object): for i in changelog_data["added_packages"]: result.append("Package: %s" % i["nvr"]) result.append("Summary: %s" % i["summary"]) - result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) + if not shorten: + result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) result.append("Size: %s bytes" % i["size"]) result.append("") result.append("") @@ -461,8 +462,9 @@ class ComposeChangelog(object): result.append("===== DROPPED PACKAGES =====") for i in changelog_data["dropped_packages"]: result.append("Package: %s" % i["nvr"]) - result.append("Summary: %s" % i["summary"]) - result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) + if not shorten: + result.append("Summary: %s" % i["summary"]) + result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) result.append("Size: %s bytes" % i["size"]) result.append("") result.append("") @@ -471,13 +473,15 @@ class ComposeChangelog(object): for i in changelog_data["upgraded_packages"]: result.append("Package: %s" % i["nvr"]) result.append("Old package: %s" % i["old_nvr"]) - result.append("Summary: %s" % i["summary"]) - result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) + if not shorten: + result.append("Summary: %s" % i["summary"]) + result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) if i["added_rpms"]: result.append("Added RPMs: %s" % " ".join(i["added_rpms"])) if i["dropped_rpms"]: result.append("Dropped RPMs: %s" % " ".join(i["dropped_rpms"])) - result.append("Size: %s bytes" % i["size"]) + if not shorten: + result.append("Size: %s bytes" % i["size"]) result.append("Size change: %s bytes" % i["size_change"]) if i["changelog"]: result.append("Changelog:") @@ -492,13 +496,15 @@ class ComposeChangelog(object): for i in changelog_data["downgraded_packages"]: result.append("Package: %s" % i["nvr"]) result.append("Old package: %s" % i["old_nvr"]) - result.append("Summary: %s" % i["summary"]) - result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) + if not shorten: + result.append("Summary: %s" % i["summary"]) + result.append("RPMs: %s" % " ".join(sorted(i["rpms"]))) if i["added_rpms"]: result.append("Added RPMs: %s" % " ".join(i["added_rpms"])) if i["dropped_rpms"]: result.append("Dropped RPMs: %s" % " ".join(i["dropped_rpms"])) - result.append("Size: %s bytes" % i["size"]) + if not shorten: + result.append("Size: %s bytes" % i["size"]) result.append("Size change: %s bytes" % i["size_change"]) if i["changelog"]: result.append("Changelog:") @@ -511,7 +517,7 @@ class ComposeChangelog(object): return "\n".join([to_utf8(i) for i in result]) - def write(self, data, path=None, name=None): + def write(self, data, path=None, name=None, verbose=False): if name: name = "changelog-%s" % name else: @@ -524,12 +530,15 @@ class ComposeChangelog(object): # json json_log = os.path.join(path, "%s.json" % name) - json.dump(data, open(json_log, "w"), sort_keys=True, indent=4) + with open(json_log, "w") as f: + json.dump(data, f, sort_keys=True, indent=4) # brief brief_log = os.path.join(path, "%s.brief" % name) - open(brief_log, "w").write(self.get_brief_log(data)) + with open(brief_log, "w") as f: + f.write(self.get_brief_log(data)) # verbose verbose_log = os.path.join(path, "%s.verbose" % name) - open(verbose_log, "w").write(self.get_verbose_log(data)) + with open(verbose_log, "w") as f: + f.write(self.get_verbose_log(data, shorten=verbose)) diff --git a/doc/compose-changelog.1 b/doc/compose-changelog.1 index b767d9f..06245a8 100644 --- a/doc/compose-changelog.1 +++ b/doc/compose-changelog.1 @@ -27,6 +27,10 @@ Set directory in which to create the files. .TP .BR \-n ", " \-\-name =\fINAME\fR Set custom identifier for the generated files. +.BR \-\-full +Print all information about packages including names of all RPMs and their +sizes. Without this option the output is shortened to only included information +about actual changes. .SH EXIT CODE This tool always exits with status code of \fB0\fR. .SH BUGS diff --git a/tests/fixtures/brief-full.txt b/tests/fixtures/brief-full.txt new file mode 100644 index 0000000..aef8a0b --- /dev/null +++ b/tests/fixtures/brief-full.txt @@ -0,0 +1,20 @@ +OLD: DP-1.0-20161022.n.0 +NEW: DP-1.0-20161025.n.0 + +===== ADDED IMAGES ===== +KDE dvd x86_64 + +===== DROPPED IMAGES ===== +MATE dvd aarch64 + +===== ADDED PACKAGES ===== +compose-utils: compose-utils-0.1.9-1.fc25 + +===== DROPPED PACKAGES ===== +fedpkg: fedpkg-1.22-1.fc25 + +===== UPGRADED PACKAGES ===== +pungi: pungi-4.1.9-1.fc25 -> pungi-4.1.10-1.fc25 + +===== DOWNGRADED PACKAGES ===== +rpkg: rpkg-1.41-2.fc25 -> rpkg-1.41-1.fc25 diff --git a/tests/fixtures/changelog-data.json b/tests/fixtures/changelog-data.json new file mode 100644 index 0000000..e54c8bc --- /dev/null +++ b/tests/fixtures/changelog-data.json @@ -0,0 +1,80 @@ +{ + "old_compose": "DP-1.0-20161022.n.0", + "new_compose": "DP-1.0-20161025.n.0", + "summary": { + "added_images": 1, + "dropped_images": 1, + "added_packages": 1, + "dropped_packages": 1, + "upgraded_packages": 1, + "downgraded_packages": 1, + "added_packages_size": 10, + "dropped_packages_size": 15, + "upgraded_packages_size": 20, + "downgraded_packages_size": 25, + "upgraded_packages_size_change": 4, + "downgraded_packages_size_change": 6 + }, + "added_images": [ + { + "subvariant": "KDE", + "type": "dvd", + "arch": "x86_64", + "path": "images/KDE-dvd.iso" + } + ], + "dropped_images": [ + { + "subvariant": "MATE", + "type": "dvd", + "arch": "aarch64", + "path": "images/MATE-dvd.iso" + } + ], + "added_packages": [ + { + "nvr": "compose-utils-0.1.9-1.fc25", + "name": "compose-utils", + "summary": "compose-utils summary", + "rpms": ["compose-utils"], + "size": 11 + } + ], + "dropped_packages": [ + { + "nvr": "fedpkg-1.22-1.fc25", + "name": "fedpkg", + "summary": "fedpkg summary", + "rpms": ["fedpkg"], + "size": 12 + } + ], + "upgraded_packages": [ + { + "name": "pungi", + "nvr": "pungi-4.1.10-1.fc25", + "old_nvr": "pungi-4.1.9-1.fc25", + "summary": "pungi summary", + "rpms": ["pungi", "pungi-utils"], + "added_rpms": ["pungi-utils"], + "dropped_rpms": ["pungi-ostree"], + "size": 13, + "size_change": 5, + "changelog": ["* Pungi changed.\n* A lot."] + } + ], + "downgraded_packages": [ + { + "name": "rpkg", + "nvr": "rpkg-1.41-1.fc25", + "old_nvr": "rpkg-1.41-2.fc25", + "summary": "rpkg summary", + "rpms": ["pyrpkg"], + "added_rpms": ["pyrpkg"], + "dropped_rpms": ["rpkg"], + "size": 14, + "size_change": 6, + "changelog": ["Rpkg changed as well."] + } + ] +} diff --git a/tests/fixtures/summary-full.txt b/tests/fixtures/summary-full.txt new file mode 100644 index 0000000..b4236b4 --- /dev/null +++ b/tests/fixtures/summary-full.txt @@ -0,0 +1,15 @@ +===== SUMMARY ===== +Added images: 1 +Dropped images: 1 +Added packages: 1 +Dropped packages: 1 +Upgraded packages: 1 +Downgraded packages: 1 + +Size of added packages: 10.00 B +Size of dropped packages: 15.00 B +Size of upgraded packages: 20.00 B +Size of downgraded packages: 25.00 B + +Size change of upgraded packages: 4.00 B +Size change of downgraded packages: 6.00 B diff --git a/tests/fixtures/verbose-full.txt b/tests/fixtures/verbose-full.txt new file mode 100644 index 0000000..36479ad --- /dev/null +++ b/tests/fixtures/verbose-full.txt @@ -0,0 +1,53 @@ +OLD: DP-1.0-20161022.n.0 +NEW: DP-1.0-20161025.n.0 + +===== ADDED IMAGES ===== +Image: KDE dvd x86_64 +Path: images/KDE-dvd.iso + +===== DROPPED IMAGES ===== +Image: MATE dvd aarch64 +Path: images/MATE-dvd.iso + +===== ADDED PACKAGES ===== +Package: compose-utils-0.1.9-1.fc25 +Summary: compose-utils summary +RPMs: compose-utils +Size: 11 bytes + + +===== DROPPED PACKAGES ===== +Package: fedpkg-1.22-1.fc25 +Summary: fedpkg summary +RPMs: fedpkg +Size: 12 bytes + + +===== UPGRADED PACKAGES ===== +Package: pungi-4.1.10-1.fc25 +Old package: pungi-4.1.9-1.fc25 +Summary: pungi summary +RPMs: pungi pungi-utils +Added RPMs: pungi-utils +Dropped RPMs: pungi-ostree +Size: 13 bytes +Size change: 5 bytes +Changelog: + * Pungi changed. + * A lot. + + + +===== DOWNGRADED PACKAGES ===== +Package: rpkg-1.41-1.fc25 +Old package: rpkg-1.41-2.fc25 +Summary: rpkg summary +RPMs: pyrpkg +Added RPMs: pyrpkg +Dropped RPMs: rpkg +Size: 14 bytes +Size change: 6 bytes +Changelog: + Rpkg changed as well. + + diff --git a/tests/fixtures/verbose-short.txt b/tests/fixtures/verbose-short.txt new file mode 100644 index 0000000..ff2b20f --- /dev/null +++ b/tests/fixtures/verbose-short.txt @@ -0,0 +1,44 @@ +OLD: DP-1.0-20161022.n.0 +NEW: DP-1.0-20161025.n.0 + +===== ADDED IMAGES ===== +Image: KDE dvd x86_64 +Path: images/KDE-dvd.iso + +===== DROPPED IMAGES ===== +Image: MATE dvd aarch64 +Path: images/MATE-dvd.iso + +===== ADDED PACKAGES ===== +Package: compose-utils-0.1.9-1.fc25 +Summary: compose-utils summary +Size: 11 bytes + + +===== DROPPED PACKAGES ===== +Package: fedpkg-1.22-1.fc25 +Size: 12 bytes + + +===== UPGRADED PACKAGES ===== +Package: pungi-4.1.10-1.fc25 +Old package: pungi-4.1.9-1.fc25 +Added RPMs: pungi-utils +Dropped RPMs: pungi-ostree +Size change: 5 bytes +Changelog: + * Pungi changed. + * A lot. + + + +===== DOWNGRADED PACKAGES ===== +Package: rpkg-1.41-1.fc25 +Old package: rpkg-1.41-2.fc25 +Added RPMs: pyrpkg +Dropped RPMs: rpkg +Size change: 6 bytes +Changelog: + Rpkg changed as well. + + diff --git a/tests/helpers.py b/tests/helpers.py index c5d9437..aa4f5d9 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -14,3 +14,8 @@ def get_compose_path(ident): def get_compose(ident): """Load a test compose and return the Compose instance.""" return productmd.compose.Compose(get_compose_path(ident)) + + +def get_fixture(filename): + base = os.path.dirname(__file__) + return os.path.join(base, 'fixtures', filename) diff --git a/tests/test_changelog.py b/tests/test_changelog.py index 2b45326..43144cd 100644 --- a/tests/test_changelog.py +++ b/tests/test_changelog.py @@ -1,9 +1,11 @@ # -*- encoding: utf-8 -*- +import json import locale +import mock import unittest -from .helpers import get_compose +from .helpers import get_compose, get_fixture import productmd.compose from compose_utils.changelog import ComposeChangelog @@ -141,5 +143,45 @@ class ChangelogTest(unittest.TestCase): str(ctx.exception)) +class TestFormat(unittest.TestCase): + def setUp(self): + super(TestFormat, self).setUp() + with open(get_fixture('changelog-data.json')) as f: + self.data = json.load(f) + + def test_summary(self): + changelog = ComposeChangelog() + with open(get_fixture('summary-full.txt')) as f: + expected = f.read().split('\n') + self.assertEqual(changelog._get_summary(self.data), + expected) + + def test_brief(self): + changelog = ComposeChangelog() + changelog._get_summary = mock.Mock(return_value=[]) + with open(get_fixture('brief-full.txt')) as f: + expected = f.read().split('\n') + self.assertEqual(changelog.get_brief_log(self.data).split('\n'), + expected) + + def test_verbose_full(self): + changelog = ComposeChangelog() + changelog._get_summary = mock.Mock(return_value=[]) + with open(get_fixture('verbose-full.txt')) as f: + expected = f.read().split('\n') + self.maxDiff = None + self.assertEqual(changelog.get_verbose_log(self.data).split('\n'), + expected) + + def test_verbose_short(self): + changelog = ComposeChangelog() + changelog._get_summary = mock.Mock(return_value=[]) + with open(get_fixture('verbose-short.txt')) as f: + expected = f.read().split('\n') + self.maxDiff = None + self.assertEqual(changelog.get_verbose_log(self.data, shorten=True).split('\n'), + expected) + + if __name__ == '__main__': unittest.main() From ef34cb54df02950c72c2a0bc9427304866d0f210 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Oct 25 2016 08:56:17 +0000 Subject: [PATCH 2/2] Move all test fixtures to the same dir Signed-off-by: Lubomír Sedlář --- diff --git a/MANIFEST.in b/MANIFEST.in index 3506e26..c8a1257 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,6 +10,5 @@ include tests/specs/build.sh recursive-include tests/composes/*/compose/metadata *.json recursive-include tests/composes *.rpm *.composeinfo include tests/*.py -include tests/move-report.json recursive-include tests/fixtures *.json *.txt include doc/*.1 diff --git a/tests/fixtures/move-report.json b/tests/fixtures/move-report.json new file mode 100644 index 0000000..e3d009d --- /dev/null +++ b/tests/fixtures/move-report.json @@ -0,0 +1,120 @@ +{ + "header": { + "new_compose": "DP-1.0-20160315.t.2", + "old_compose": "DP-1.0-20160315.t.0" + }, + "moved_items": [ + { + "arch": "x86_64", + "from": "Server", + "items": { + "dummy-tftp-debuginfo.x86_64": [ + { + "category": "debug", + "path": "Server/x86_64/debug/tree/Packages/d/dummy-tftp-debuginfo-5.2-6.x86_64.rpm", + "rpm_arch": "x86_64", + "rpm_name": "dummy-tftp-debuginfo", + "rpm_nevra": "dummy-tftp-debuginfo-0:5.2-6.x86_64", + "srpm_nevra": "dummy-tftp-0:5.2-6.src" + } + ], + "dummy-tftp.src": [ + { + "category": "source", + "path": "Server/source/tree/Packages/d/dummy-tftp-5.2-6.src.rpm", + "rpm_arch": "src", + "rpm_name": "dummy-tftp", + "rpm_nevra": "dummy-tftp-0:5.2-6.src", + "srpm_nevra": "dummy-tftp-0:5.2-6.src" + } + ], + "dummy-tftp.x86_64": [ + { + "category": "binary", + "path": "Server/x86_64/os/Packages/d/dummy-tftp-5.2-6.x86_64.rpm", + "rpm_arch": "x86_64", + "rpm_name": "dummy-tftp", + "rpm_nevra": "dummy-tftp-0:5.2-6.x86_64", + "srpm_nevra": "dummy-tftp-0:5.2-6.src" + } + ] + }, + "parent": "Server", + "to": "Server-optional" + }, + { + "arch": "x86_64", + "from": "Server-optional", + "items": {}, + "parent": "Server", + "to": "Server" + }, + { + "arch": "s390x", + "from": "Server", + "items": {}, + "parent": "Server", + "to": "Server-optional" + }, + { + "arch": "s390x", + "from": "Server-optional", + "items": {}, + "parent": "Server", + "to": "Server" + } + ], + "new_items": { + "Server-optional.s390x": { + "arch": "s390x", + "items": {}, + "variant": "Server-optional" + }, + "Server-optional.x86_64": { + "arch": "x86_64", + "items": { + "dummy-tftp-debuginfo.x86_64": [ + { + "category": "debug", + "path": "Server/x86_64/debug/tree/Packages/d/dummy-tftp-debuginfo-5.2-6.x86_64.rpm", + "rpm_arch": "x86_64", + "rpm_name": "dummy-tftp-debuginfo", + "rpm_nevra": "dummy-tftp-debuginfo-0:5.2-6.x86_64", + "srpm_nevra": "dummy-tftp-0:5.2-6.src" + } + ], + "dummy-tftp.src": [ + { + "category": "source", + "path": "Server/source/tree/Packages/d/dummy-tftp-5.2-6.src.rpm", + "rpm_arch": "src", + "rpm_name": "dummy-tftp", + "rpm_nevra": "dummy-tftp-0:5.2-6.src", + "srpm_nevra": "dummy-tftp-0:5.2-6.src" + } + ], + "dummy-tftp.x86_64": [ + { + "category": "binary", + "path": "Server/x86_64/os/Packages/d/dummy-tftp-5.2-6.x86_64.rpm", + "rpm_arch": "x86_64", + "rpm_name": "dummy-tftp", + "rpm_nevra": "dummy-tftp-0:5.2-6.x86_64", + "srpm_nevra": "dummy-tftp-0:5.2-6.src" + } + ] + }, + "variant": "Server-optional" + }, + "Server.s390x": { + "arch": "s390x", + "items": {}, + "variant": "Server" + }, + "Server.x86_64": { + "arch": "x86_64", + "items": {}, + "variant": "Server" + } + } +} \ No newline at end of file diff --git a/tests/move-report.json b/tests/move-report.json deleted file mode 100644 index e3d009d..0000000 --- a/tests/move-report.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "header": { - "new_compose": "DP-1.0-20160315.t.2", - "old_compose": "DP-1.0-20160315.t.0" - }, - "moved_items": [ - { - "arch": "x86_64", - "from": "Server", - "items": { - "dummy-tftp-debuginfo.x86_64": [ - { - "category": "debug", - "path": "Server/x86_64/debug/tree/Packages/d/dummy-tftp-debuginfo-5.2-6.x86_64.rpm", - "rpm_arch": "x86_64", - "rpm_name": "dummy-tftp-debuginfo", - "rpm_nevra": "dummy-tftp-debuginfo-0:5.2-6.x86_64", - "srpm_nevra": "dummy-tftp-0:5.2-6.src" - } - ], - "dummy-tftp.src": [ - { - "category": "source", - "path": "Server/source/tree/Packages/d/dummy-tftp-5.2-6.src.rpm", - "rpm_arch": "src", - "rpm_name": "dummy-tftp", - "rpm_nevra": "dummy-tftp-0:5.2-6.src", - "srpm_nevra": "dummy-tftp-0:5.2-6.src" - } - ], - "dummy-tftp.x86_64": [ - { - "category": "binary", - "path": "Server/x86_64/os/Packages/d/dummy-tftp-5.2-6.x86_64.rpm", - "rpm_arch": "x86_64", - "rpm_name": "dummy-tftp", - "rpm_nevra": "dummy-tftp-0:5.2-6.x86_64", - "srpm_nevra": "dummy-tftp-0:5.2-6.src" - } - ] - }, - "parent": "Server", - "to": "Server-optional" - }, - { - "arch": "x86_64", - "from": "Server-optional", - "items": {}, - "parent": "Server", - "to": "Server" - }, - { - "arch": "s390x", - "from": "Server", - "items": {}, - "parent": "Server", - "to": "Server-optional" - }, - { - "arch": "s390x", - "from": "Server-optional", - "items": {}, - "parent": "Server", - "to": "Server" - } - ], - "new_items": { - "Server-optional.s390x": { - "arch": "s390x", - "items": {}, - "variant": "Server-optional" - }, - "Server-optional.x86_64": { - "arch": "x86_64", - "items": { - "dummy-tftp-debuginfo.x86_64": [ - { - "category": "debug", - "path": "Server/x86_64/debug/tree/Packages/d/dummy-tftp-debuginfo-5.2-6.x86_64.rpm", - "rpm_arch": "x86_64", - "rpm_name": "dummy-tftp-debuginfo", - "rpm_nevra": "dummy-tftp-debuginfo-0:5.2-6.x86_64", - "srpm_nevra": "dummy-tftp-0:5.2-6.src" - } - ], - "dummy-tftp.src": [ - { - "category": "source", - "path": "Server/source/tree/Packages/d/dummy-tftp-5.2-6.src.rpm", - "rpm_arch": "src", - "rpm_name": "dummy-tftp", - "rpm_nevra": "dummy-tftp-0:5.2-6.src", - "srpm_nevra": "dummy-tftp-0:5.2-6.src" - } - ], - "dummy-tftp.x86_64": [ - { - "category": "binary", - "path": "Server/x86_64/os/Packages/d/dummy-tftp-5.2-6.x86_64.rpm", - "rpm_arch": "x86_64", - "rpm_name": "dummy-tftp", - "rpm_nevra": "dummy-tftp-0:5.2-6.x86_64", - "srpm_nevra": "dummy-tftp-0:5.2-6.src" - } - ] - }, - "variant": "Server-optional" - }, - "Server.s390x": { - "arch": "s390x", - "items": {}, - "variant": "Server" - }, - "Server.x86_64": { - "arch": "x86_64", - "items": {}, - "variant": "Server" - } - } -} \ No newline at end of file diff --git a/tests/test_report_move.py b/tests/test_report_move.py index 5c71c71..137fbcc 100644 --- a/tests/test_report_move.py +++ b/tests/test_report_move.py @@ -2,9 +2,8 @@ import json import unittest -import os -from .helpers import get_compose +from .helpers import get_compose, get_fixture from compose_utils.package_moves import ComposePackageMoves @@ -12,7 +11,7 @@ from compose_utils.package_moves import ComposePackageMoves class ReportMoveTest(unittest.TestCase): def setUp(self): - with open(os.path.join(os.path.dirname(__file__), 'move-report.json')) as f: + with open(get_fixture('move-report.json')) as f: self.expected = json.load(f) def test_package_moves(self):