diff options
author | pje <pje@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2005-08-14 01:45:38 +0000 |
---|---|---|
committer | pje <pje@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2005-08-14 01:45:38 +0000 |
commit | fcd7e21ea4c48da65744c34c47c23ef4c8a334aa (patch) | |
tree | 83e46285d0fadf68ee4aa8e7fc46efb27d6e85c0 /setuptools/tests/test_resources.py | |
parent | 533976848d4ea581b4ce2fd46295a216621d757b (diff) | |
download | python-setuptools-fcd7e21ea4c48da65744c34c47c23ef4c8a334aa.tar.gz |
Document the "Environment" class, and simplify its API.
git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@41194 6015fed2-1504-0410-9fe1-9d1591cc4771
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 ed65167..ee3de5c 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")) |