diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-06-17 13:47:41 (GMT) |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-06-17 13:47:41 (GMT) |
| commit | ed5d2f131083f16ab3d305ccc6f58c66f70f1f75 (patch) | |
| tree | 9f4de37461401f9f541df24d7c04effe81f7f2a4 /Lib/packaging/tests/test_pypi_dist.py | |
| parent | c06f46f74c4a5f3cc46aa3a6d1c9cc1cb187e4c4 (diff) | |
| download | cpython-ed5d2f131083f16ab3d305ccc6f58c66f70f1f75.zip cpython-ed5d2f131083f16ab3d305ccc6f58c66f70f1f75.tar.gz cpython-ed5d2f131083f16ab3d305ccc6f58c66f70f1f75.tar.bz2 | |
Minor tweaks to packaging tests.
- Move a tearDown method right after setUp
- Use assertRaises instead of reinventing it
- Skip a test instead of commenting it out, as a reminder
Diffstat (limited to 'Lib/packaging/tests/test_pypi_dist.py')
| -rw-r--r-- | Lib/packaging/tests/test_pypi_dist.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Lib/packaging/tests/test_pypi_dist.py b/Lib/packaging/tests/test_pypi_dist.py index 0c88c9b..ff9a16e 100644 --- a/Lib/packaging/tests/test_pypi_dist.py +++ b/Lib/packaging/tests/test_pypi_dist.py @@ -239,7 +239,6 @@ class TestReleasesList(unittest.TestCase): def test_prefer_final(self): # Can order the distributions using prefer_final - fb10 = ReleaseInfo("FooBar", "1.0") # final distribution fb11a = ReleaseInfo("FooBar", "1.1a1") # alpha fb12a = ReleaseInfo("FooBar", "1.2a1") # alpha @@ -252,22 +251,23 @@ class TestReleasesList(unittest.TestCase): dists.sort_releases(prefer_final=False) self.assertEqual(fb12b, dists[0]) -# def test_prefer_source(self): -# # Ordering support prefer_source -# fb_source = Dist("FooBar", "1.0", type="source") -# fb_binary = Dist("FooBar", "1.0", type="binary") -# fb2_binary = Dist("FooBar", "2.0", type="binary") -# dists = ReleasesList([fb_binary, fb_source]) -# -# dists.sort_distributions(prefer_source=True) -# self.assertEqual(fb_source, dists[0]) -# -# dists.sort_distributions(prefer_source=False) -# self.assertEqual(fb_binary, dists[0]) -# -# dists.append(fb2_binary) -# dists.sort_distributions(prefer_source=True) -# self.assertEqual(fb2_binary, dists[0]) + @unittest.skip('method not implemented yet') + def test_prefer_source(self): + # Ordering supports prefer_source + fb_source = Dist("FooBar", "1.0", type="source") + fb_binary = Dist("FooBar", "1.0", type="binary") + fb2_binary = Dist("FooBar", "2.0", type="binary") + dists = ReleasesList([fb_binary, fb_source]) + + dists.sort_distributions(prefer_source=True) + self.assertEqual(fb_source, dists[0]) + + dists.sort_distributions(prefer_source=False) + self.assertEqual(fb_binary, dists[0]) + + dists.append(fb2_binary) + dists.sort_distributions(prefer_source=True) + self.assertEqual(fb2_binary, dists[0]) def test_get_last(self): dists = ReleasesList('Foo') |
