Commit 2de12a23 authored by Ronny Pfannschmidt's avatar Ronny Pfannschmidt

add some tests for the pth writer/manager

--HG--
branch : distribute
extra : rebase_source : b7e6abf35a947b39b6290b076f618ce75211757e
parent dcd1dd38
......@@ -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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment