From da0f226cc461bb6555f459e3fd7b4af51ca7a63a Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Wed, 24 Sep 2014 10:36:06 +1200 Subject: Test that MANIFEST.in excludes work We were not testing that MANIFEST.in excludes work. Change-Id: Id6e1d1651a930379b18e4d9efe2e3a8baa03dc12 Closes-Bug: #1373152 --- pbr/tests/test_packaging.py | 9 +++++++++ pbr/tests/testpackage/MANIFEST.in | 1 + pbr/tests/testpackage/pbr_testpackage/extra.py | 0 3 files changed, 10 insertions(+) create mode 100644 pbr/tests/testpackage/pbr_testpackage/extra.py diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py index 5615d28..eac76b2 100644 --- a/pbr/tests/test_packaging.py +++ b/pbr/tests/test_packaging.py @@ -167,6 +167,15 @@ class TestPackagingInGitRepoWithCommit(base.BaseTestCase): # One commit, something should be in the ChangeLog list self.assertNotEqual(body, '') + def test_manifest_exclude_honoured(self): + with open(os.path.join( + self.package_dir, + 'pbr_testpackage.egg-info/SOURCES.txt'), 'r') as f: + body = f.read() + self.assertThat( + body, matchers.Not(matchers.Contains('pbr_testpackage/extra.py'))) + self.assertThat(body, matchers.Contains('pbr_testpackage/__init__.py')) + class TestPackagingInGitRepoWithoutCommit(base.BaseTestCase): diff --git a/pbr/tests/testpackage/MANIFEST.in b/pbr/tests/testpackage/MANIFEST.in index cdc95ea..2e35f3e 100644 --- a/pbr/tests/testpackage/MANIFEST.in +++ b/pbr/tests/testpackage/MANIFEST.in @@ -1 +1,2 @@ include data_files/* +exclude pbr_testpackage/extra.py diff --git a/pbr/tests/testpackage/pbr_testpackage/extra.py b/pbr/tests/testpackage/pbr_testpackage/extra.py new file mode 100644 index 0000000..e69de29 -- cgit v1.2.1