[Python-checkins]
python/nondist/sandbox/setuptools/setuptools/tests
test_resources.py, NONE, 1.1 __init__.py, 1.5, 1.6
pje at users.sourceforge.net
pje at users.sourceforge.net
Sat Apr 2 04:43:23 CEST 2005
- Previous message: [Python-checkins]
python/nondist/sandbox/setuptools/setuptools/command
bdist_egg.py, 1.5, 1.6
- Next message: [Python-checkins] python/dist/src/Python Python-ast.c, 1.1.2.10,
1.1.2.11 ast.c, 1.1.2.56, 1.1.2.57 newcompile.c, 1.1.2.104,
1.1.2.105 symtable.c, 2.10.8.30, 2.10.8.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17398/setuptools/tests
Modified Files:
__init__.py
Added Files:
test_resources.py
Log Message:
Rough draft of version requirement parser. Make bdist_egg look for a
distname.egg-info directory instead of EGG-INFO.in; this will be used later
to support development of egg-distributed packages that an application
under development expects to 'require()'. (Thanks to Fred Drake for
pointing out this use case, and Bob Ippolito for helping me figure out how
to support it, although the runtime support doesn't actually exist yet.)
--- NEW FILE: test_resources.py ---
from unittest import TestCase, makeSuite
from pkg_resources import *
import pkg_resources
class DistroTests(TestCase):
def testEmptyiter(self):
# empty path should produce no distributions
self.assertEqual(list(iter_distributions(path=[])), [])
class ParseTests(TestCase):
def testEmptyParse(self):
self.assertEqual(list(parse_requirements('')), [])
def testYielding(self):
for inp,out in [
([], []), ('x',['x']), ([[]],[]), (' x\n y', ['x','y']),
(['x\n\n','y'], ['x','y']),
]:
self.assertEqual(list(pkg_resources.yield_lines(inp)),out)
def testSimple(self):
self.assertEqual(
list(parse_requirements('Twis-Ted>=1.2')),
[('Twis_Ted',[('>=','1.2')])]
)
self.assertEqual(
list(parse_requirements('Twisted >=1.2, \ # more\n<2.0')),
[('Twisted',[('>=','1.2'),('<','2.0')])]
)
self.assertRaises(ValueError,lambda:list(parse_requirements(">=2.3")))
self.assertRaises(ValueError,lambda:list(parse_requirements("x\\")))
self.assertRaises(ValueError,lambda:list(parse_requirements("x==2 q")))
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/tests/__init__.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- __init__.py 1 Apr 2005 21:28:49 -0000 1.5
+++ __init__.py 2 Apr 2005 02:43:21 -0000 1.6
@@ -1,6 +1,6 @@
"""Tests for the 'setuptools' package"""
-from unittest import TestSuite, TestCase, makeSuite
+from unittest import TestSuite, TestCase, makeSuite, defaultTestLoader
import distutils.core, distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
@@ -409,13 +409,13 @@
testClasses = (DependsTests, DistroTests, FeatureTests, TestCommandTests)
+testNames = ["setuptools.tests.test_resources"]
def test_suite():
- return TestSuite([makeSuite(t,'test') for t in testClasses])
-
-
-
-
+ return TestSuite(
+ [makeSuite(t,'test') for t in testClasses]+
+ [defaultTestLoader.loadTestsFromName(n) for n in testNames]
+ )
- Previous message: [Python-checkins]
python/nondist/sandbox/setuptools/setuptools/command
bdist_egg.py, 1.5, 1.6
- Next message: [Python-checkins] python/dist/src/Python Python-ast.c, 1.1.2.10,
1.1.2.11 ast.c, 1.1.2.56, 1.1.2.57 newcompile.c, 1.1.2.104,
1.1.2.105 symtable.c, 2.10.8.30, 2.10.8.31
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list