diff options
-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) + |