From 7c4938d53774c51b441970e177ce72cc3bdf68ce Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Fri, 18 Jan 2008 21:51:23 +0000 Subject: chmod/test cleanups and Jython compatibility (backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4060062 --- setuptools/tests/test_resources.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'setuptools/tests/test_resources.py') diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 1b15a9eb..1dc078ab 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -39,8 +39,6 @@ class DistroTests(TestCase): # But only 1 package self.assertEqual(list(ad), ['foopkg']) - - # Distributions sort by version self.assertEqual( [dist.version for dist in ad['FooPkg']], ['1.4','1.3-1','1.2'] @@ -255,14 +253,15 @@ class EntryPointTests(TestCase): else: raise AssertionError("Should've been bad", ep) def checkSubMap(self, m): - self.assertEqual(str(m), - "{'feature2': EntryPoint.parse(" - "'feature2 = another.module:SomeClass [extra1,extra2]'), " - "'feature3': EntryPoint.parse('feature3 = this.module [something]'), " - "'feature1': EntryPoint.parse(" - "'feature1 = somemodule:somefunction')}" - ) - + self.assertEqual(len(m), len(self.submap_expect)) + for key, ep in self.submap_expect.iteritems(): + self.assertEqual(repr(m.get(key)), repr(ep)) + + submap_expect = dict( + feature1=EntryPoint('feature1', 'somemodule', ['somefunction']), + feature2=EntryPoint('feature2', 'another.module', ['SomeClass'], ['extra1','extra2']), + feature3=EntryPoint('feature3', 'this.module', extras=['something']) + ) submap_str = """ # define features for blah blah feature1 = somemodule:somefunction @@ -286,7 +285,6 @@ class EntryPointTests(TestCase): self.assertRaises(ValueError, EntryPoint.parse_map, ["[xyz]", "[xyz]"]) self.assertRaises(ValueError, EntryPoint.parse_map, self.submap_str) - class RequirementsTests(TestCase): def testBasics(self): -- cgit v1.2.3