diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-03 13:14:22 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-03 13:14:22 -0400 |
commit | 118e245064fe77ea85ae936223edf09ff1448314 (patch) | |
tree | 5c0a46bae89063ee18cc7352c16381aa26f6c3c9 | |
parent | 0515f30739d1dce3bc10921db403f336358ef447 (diff) | |
download | external_python_setuptools-118e245064fe77ea85ae936223edf09ff1448314.tar.gz external_python_setuptools-118e245064fe77ea85ae936223edf09ff1448314.tar.bz2 external_python_setuptools-118e245064fe77ea85ae936223edf09ff1448314.zip |
Add test capturing failure when find_packages no longer follows symlinks. Ref #195
--HG--
extra : amend_source : 4efa6b87d3acaefebdfcc953e78a452ffc1f160d
-rw-r--r-- | setuptools.egg-info/requires.txt | 8 | ||||
-rw-r--r-- | setuptools/tests/test_find_packages.py | 25 |
2 files changed, 29 insertions, 4 deletions
diff --git a/setuptools.egg-info/requires.txt b/setuptools.egg-info/requires.txt index e5db30ad..a49a923e 100644 --- a/setuptools.egg-info/requires.txt +++ b/setuptools.egg-info/requires.txt @@ -1,7 +1,7 @@ -[ssl:sys_platform=='win32'] -wincertstore==0.2 - [certs] -certifi==1.0.1
\ No newline at end of file +certifi==1.0.1 + +[ssl:sys_platform=='win32'] +wincertstore==0.2
\ No newline at end of file diff --git a/setuptools/tests/test_find_packages.py b/setuptools/tests/test_find_packages.py index 47ea9e05..92f7aff7 100644 --- a/setuptools/tests/test_find_packages.py +++ b/setuptools/tests/test_find_packages.py @@ -1,14 +1,24 @@ """Tests for setuptools.find_packages().""" import os +import sys import shutil import tempfile import unittest +import platform import setuptools from setuptools import find_packages +from setuptools.tests.py26compat import skipIf find_420_packages = setuptools.PEP420PackageFinder.find +def has_symlink(): + bad_symlink = ( + # Windows symlink directory detection is broken on Python 3.2 + platform.system() == 'Windows' and sys.version_info[:2] == (3,2) + ) + return hasattr(os, 'symlink') and not bad_symlink + class TestFindPackages(unittest.TestCase): def setUp(self): @@ -99,6 +109,21 @@ class TestFindPackages(unittest.TestCase): packages = find_packages(self.dist_dir) self.assertTrue('build.pkg' not in packages) + @skipIf(not has_symlink(), 'Symlink support required') + def test_symlinked_packages_are_included(self): + """ + A symbolically-linked directory should be treated like any other + directory when matched as a package. + + Create a link from lpkg -> pkg. + """ + self._touch('__init__.py', self.pkg_dir) + linked_pkg = os.path.join(self.dist_dir, 'lpkg') + os.symlink('pkg', linked_pkg) + assert os.path.isdir(linked_pkg) + packages = find_packages(self.dist_dir) + self.assertTrue('lpkg' in packages) + def _assert_packages(self, actual, expected): self.assertEqual(set(actual), set(expected)) |