diff options
| author | PJ Eby <distutils-sig@python.org> | 2005-08-14 01:45:38 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2005-08-14 01:45:38 +0000 |
| commit | 15233b3d39a81fb7164465f65b182eee65983b56 (patch) | |
| tree | 83e46285d0fadf68ee4aa8e7fc46efb27d6e85c0 /setuptools/tests/test_resources.py | |
| parent | 8672fe00fe29ded78363f55a358c168774c7d9b4 (diff) | |
| download | python-setuptools-git-15233b3d39a81fb7164465f65b182eee65983b56.tar.gz | |
Document the "Environment" class, and simplify its API.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041194
Diffstat (limited to 'setuptools/tests/test_resources.py')
| -rw-r--r-- | setuptools/tests/test_resources.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index ed651675..ee3de5c5 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -25,19 +25,19 @@ class DistroTests(TestCase): # empty path should produce no distributions ad = Environment([], python=None) self.assertEqual(list(ad), []) - self.assertEqual(len(ad),0) - self.assertEqual(ad.get('FooPkg'),None) - self.failIf('FooPkg' in ad) + self.assertEqual(ad['FooPkg'],[]) + ad.add(Distribution.from_filename("FooPkg-1.3_1.egg")) ad.add(Distribution.from_filename("FooPkg-1.4-py2.4-win32.egg")) ad.add(Distribution.from_filename("FooPkg-1.2-py2.4.egg")) # Name is in there now - self.failUnless('FooPkg' in ad) + self.failUnless(ad['FooPkg']) # But only 1 package self.assertEqual(list(ad), ['foopkg']) - self.assertEqual(len(ad),1) + + # Distributions sort by version self.assertEqual( @@ -46,7 +46,7 @@ class DistroTests(TestCase): # Removing a distribution leaves sequence alone ad.remove(ad['FooPkg'][1]) self.assertEqual( - [dist.version for dist in ad.get('FooPkg')], ['1.4','1.2'] + [dist.version for dist in ad['FooPkg']], ['1.4','1.2'] ) # And inserting adds them in order ad.add(Distribution.from_filename("FooPkg-1.9.egg")) |
