aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_packageindex.py6
-rw-r--r--setuptools/tests/test_resources.py20
2 files changed, 12 insertions, 14 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index a2ca36ad..2d619a08 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -2,7 +2,7 @@
"""
# More would be better!
-import os, shutil, tempfile, unittest
+import os, shutil, tempfile, unittest, urllib2
import pkg_resources
import setuptools.package_index
@@ -12,8 +12,8 @@ class TestPackageIndex(unittest.TestCase):
index = setuptools.package_index.PackageIndex()
url = 'http://127.0.0.1/nonesuch/test_package_index'
try:
- index.open_url(url)
+ v = index.open_url(url)
except Exception, v:
self.assert_(url in str(v))
else:
- self.assert_(False)
+ self.assert_(isinstance(v,urllib2.HTTPError))
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):