Commit db165ca6 authored by Jason R. Coombs's avatar Jason R. Coombs

Add test for find_packages(include=)

--HG--
extra : rebase_source : bee4238f4cd00fa8bd3104017f4caf234dcf0729
parent cc20858d
...@@ -63,6 +63,16 @@ class TestFindPackages(unittest.TestCase): ...@@ -63,6 +63,16 @@ class TestFindPackages(unittest.TestCase):
packages = find_packages(self.dist_dir) packages = find_packages(self.dist_dir)
self.assertEqual(packages, ['pkg', 'pkg.subpkg']) self.assertEqual(packages, ['pkg', 'pkg.subpkg'])
def test_include_excludes_other(self):
"""
If include is specified, other packages should be excluded.
"""
self._touch('__init__.py', self.pkg_dir)
alt_dir = self._mkdir('other_pkg', self.dist_dir)
self._touch('__init__.py', alt_dir)
packages = find_packages(self.dist_dir, include=['other_pkg'])
self.assertEqual(packages, ['other_pkg'])
def test_dir_with_dot_is_skipped(self): def test_dir_with_dot_is_skipped(self):
shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets')) shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets'))
data_dir = self._mkdir('some.data', self.pkg_dir) data_dir = self._mkdir('some.data', self.pkg_dir)
......
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