diff options
author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> | 2010-02-11 17:04:22 +0100 |
---|---|---|
committer | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> | 2010-02-11 17:04:22 +0100 |
commit | 2de12a23118f5eff414f232e0fdb50dd74362fa9 (patch) | |
tree | 12d0aca158472b6d561116eef598831ddff0830d | |
parent | dcd1dd3857242fe3463d68cb19abfe431f520f92 (diff) | |
download | external_python_setuptools-2de12a23118f5eff414f232e0fdb50dd74362fa9.tar.gz external_python_setuptools-2de12a23118f5eff414f232e0fdb50dd74362fa9.tar.bz2 external_python_setuptools-2de12a23118f5eff414f232e0fdb50dd74362fa9.zip |
add some tests for the pth writer/manager
--HG--
branch : distribute
extra : rebase_source : b7e6abf35a947b39b6290b076f618ce75211757e
-rw-r--r-- | setuptools/tests/test_easy_install.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 95909ca7..ff9fa31d 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -3,7 +3,9 @@ import sys import os, shutil, tempfile, unittest from setuptools.command.easy_install import easy_install, get_script_args, main +from setuptools.command.easy_install import PthDistributions from setuptools.dist import Distribution +from pkg_resources import Distribution as PRDistribution class FakeDist(object): def get_entry_map(self, group): @@ -90,3 +92,19 @@ class TestEasyInstallTest(unittest.TestCase): os.chdir(old_wd) shutil.rmtree(dir) +class TestPTHFileWriter(unittest.TestCase): + def test_add_from_cwd_site_sets_dirty(self): + '''a pth file manager should set dirty + if a distribution is in site but also the cwd + ''' + pth = PthDistributions('does-not_exist', [os.getcwd()]) + self.assertFalse(pth.dirty) + pth.add(PRDistribution(os.getcwd())) + self.assertTrue(pth.dirty) + + def test_add_from_site_is_ignored(self): + pth = PthDistributions('does-not_exist', ['/test/location/does-not-have-to-exist']) + self.assertFalse(pth.dirty) + pth.add(PRDistribution('/test/location/does-not-have-to-exist')) + self.assertFalse(pth.dirty) + |