diff options
author | Erik M. Bray <embray@stsci.edu> | 2013-02-27 15:19:04 -0500 |
---|---|---|
committer | Erik M. Bray <embray@stsci.edu> | 2013-02-28 18:39:44 -0500 |
commit | ea2e44ffc729fb7d5e27b6771f7191e94b9e1c66 (patch) | |
tree | 0af4532ba321dfc13fd9e284eb850e72f2e6e14c /pbr | |
parent | 79c7c67fb4fc71206bc5cf9e77a95ae887d69d7e (diff) | |
download | pbr-ea2e44ffc729fb7d5e27b6771f7191e94b9e1c66.tar.gz |
This is a test that should really work to test this feature
Diffstat (limited to 'pbr')
-rw-r--r-- | pbr/d2to1/tests/test_core.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pbr/d2to1/tests/test_core.py b/pbr/d2to1/tests/test_core.py index efb1b02..d7962f4 100644 --- a/pbr/d2to1/tests/test_core.py +++ b/pbr/d2to1/tests/test_core.py @@ -1,3 +1,7 @@ +import glob +import os +import tarfile + from . import D2to1TestCase @@ -24,3 +28,21 @@ class TestCore(D2to1TestCase): self.run_setup('egg_info') stdout, _, _ = self.run_setup('--keywords') assert stdout == 'packaging,distutils,setuptools' + + def test_sdist_extra_files(self): + """ + Test that the extra files are correctly added. + """ + + stdout, _, return_code = self.run_setup('sdist', '--formats=gztar') + + # There can be only one + try: + tf_path = glob.glob(os.path.join('dist', '*.tar.gz'))[0] + except IndexError: + assert False, 'source dist not found' + + tf = tarfile.open(tf_path) + names = ['/'.join(p.split('/')[1:]) for p in tf.getnames()] + + assert 'extra-file.txt' in names |