aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_resources.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-09-26 00:35:35 +0000
committerPJ Eby <distutils-sig@python.org>2005-09-26 00:35:35 +0000
commitcbbc6e760110c451210433ee4a89354128ca8680 (patch)
tree52eee49f6283b33e11c58d7c8871420991a9b96e /setuptools/tests/test_resources.py
parent20e9f30cb2de19a4d4cdc1aa53e07efc9c34bcb0 (diff)
downloadexternal_python_setuptools-cbbc6e760110c451210433ee4a89354128ca8680.tar.gz
external_python_setuptools-cbbc6e760110c451210433ee4a89354128ca8680.tar.bz2
external_python_setuptools-cbbc6e760110c451210433ee4a89354128ca8680.zip
Ensure that WorkingSet.resolve() (and therefore require() as well)
returns a list of the relevant distributions, even if they are found in the working set rather than the environment. This fixes some problems in the 0.6a3 release. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041256
Diffstat (limited to 'setuptools/tests/test_resources.py')
-rw-r--r--setuptools/tests/test_resources.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py
index 87648f1c..5b9751f9 100644
--- a/setuptools/tests/test_resources.py
+++ b/setuptools/tests/test_resources.py
@@ -123,7 +123,6 @@ class DistroTests(TestCase):
def testResolve(self):
ad = Environment([]); ws = WorkingSet([])
-
# Resolving no requirements -> nothing to install
self.assertEqual( list(ws.resolve([],ad)), [] )
@@ -131,7 +130,6 @@ class DistroTests(TestCase):
self.assertRaises(
DistributionNotFound, ws.resolve, parse_requirements("Foo"), ad
)
-
Foo = Distribution.from_filename(
"/foo_dir/Foo-1.2.egg",
metadata=Metadata(('depends.txt', "[bar]\nBaz>=2.0"))
@@ -139,10 +137,12 @@ class DistroTests(TestCase):
ad.add(Foo)
# Request thing(s) that are available -> list to activate
- self.assertEqual(
- list(ws.resolve(parse_requirements("Foo"), ad)), [Foo]
- )
-
+ for i in range(3):
+ targets = list(ws.resolve(parse_requirements("Foo"), ad))
+ self.assertEqual(targets, [Foo])
+ map(ws.add,targets)
+ ws = WorkingSet([]) # reset
+
# Request an extra that causes an unresolved dependency for "Baz"
self.assertRaises(
DistributionNotFound, ws.resolve,parse_requirements("Foo[bar]"), ad