[Python-checkins] python/nondist/sandbox/setuptools/setuptools/tests test_resources.py, 1.24, 1.25
pje@users.sourceforge.net
pje at users.sourceforge.net
Mon Sep 26 02:35:38 CEST 2005
Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27298/setuptools/tests
Modified Files:
test_resources.py
Log Message:
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.
Index: test_resources.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/tests/test_resources.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- test_resources.py 24 Sep 2005 19:48:28 -0000 1.24
+++ test_resources.py 26 Sep 2005 00:35:35 -0000 1.25
@@ -123,7 +123,6 @@
def testResolve(self):
ad = Environment([]); ws = WorkingSet([])
-
# Resolving no requirements -> nothing to install
self.assertEqual( list(ws.resolve([],ad)), [] )
@@ -131,7 +130,6 @@
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 @@
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
More information about the Python-checkins
mailing list