diff options
| author | Michael Merickel <michael@merickel.org> | 2018-10-15 01:55:54 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2018-10-15 09:24:07 -0500 |
| commit | 0c29cf2df41600d3906d521c72991c7686018b71 (patch) | |
| tree | ff907f90ec9467e12874c9b2c961549d0e7caf74 /tests/test_scripts/test_pdistreport.py | |
| parent | 851c368e3c158e264358de10446f5b5de240e534 (diff) | |
| download | pyramid-0c29cf2df41600d3906d521c72991c7686018b71.tar.gz pyramid-0c29cf2df41600d3906d521c72991c7686018b71.tar.bz2 pyramid-0c29cf2df41600d3906d521c72991c7686018b71.zip | |
format source using black
Diffstat (limited to 'tests/test_scripts/test_pdistreport.py')
| -rw-r--r-- | tests/test_scripts/test_pdistreport.py | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/tests/test_scripts/test_pdistreport.py b/tests/test_scripts/test_pdistreport.py index e229667c5..031a6ff2b 100644 --- a/tests/test_scripts/test_pdistreport.py +++ b/tests/test_scripts/test_pdistreport.py @@ -1,57 +1,68 @@ import unittest + class TestPDistReportCommand(unittest.TestCase): def _callFUT(self, **kw): argv = [] from pyramid.scripts.pdistreport import main + return main(argv, **kw) def test_no_dists(self): def platform(): return 'myplatform' + pkg_resources = DummyPkgResources() L = [] + def out(*args): L.extend(args) - result = self._callFUT(pkg_resources=pkg_resources, platform=platform, - out=out) + + result = self._callFUT( + pkg_resources=pkg_resources, platform=platform, out=out + ) self.assertEqual(result, None) self.assertEqual( L, - ['Pyramid version:', '1', - 'Platform:', 'myplatform', - 'Packages:'] - ) + ['Pyramid version:', '1', 'Platform:', 'myplatform', 'Packages:'], + ) def test_with_dists(self): def platform(): return 'myplatform' + working_set = (DummyDistribution('abc'), DummyDistribution('def')) pkg_resources = DummyPkgResources(working_set) L = [] + def out(*args): L.extend(args) - result = self._callFUT(pkg_resources=pkg_resources, platform=platform, - out=out) + + result = self._callFUT( + pkg_resources=pkg_resources, platform=platform, out=out + ) self.assertEqual(result, None) self.assertEqual( L, - ['Pyramid version:', - '1', - 'Platform:', - 'myplatform', - 'Packages:', - ' ', - 'abc', - '1', - ' ', - '/projects/abc', - ' ', - 'def', - '1', - ' ', - '/projects/def'] - ) + [ + 'Pyramid version:', + '1', + 'Platform:', + 'myplatform', + 'Packages:', + ' ', + 'abc', + '1', + ' ', + '/projects/abc', + ' ', + 'def', + '1', + ' ', + '/projects/def', + ], + ) + class DummyPkgResources(object): def __init__(self, working_set=()): @@ -60,14 +71,14 @@ class DummyPkgResources(object): def get_distribution(self, name): return Version('1') + class Version(object): def __init__(self, version): self.version = version + class DummyDistribution(object): def __init__(self, name): self.project_name = name self.version = '1' self.location = '/projects/%s' % name - - |
