| 1 | n/a | """Tests for packaging.command.sdist.""" |
|---|
| 2 | n/a | import os |
|---|
| 3 | n/a | import tarfile |
|---|
| 4 | n/a | import zipfile |
|---|
| 5 | n/a | |
|---|
| 6 | n/a | try: |
|---|
| 7 | n/a | import grp |
|---|
| 8 | n/a | import pwd |
|---|
| 9 | n/a | UID_GID_SUPPORT = True |
|---|
| 10 | n/a | except ImportError: |
|---|
| 11 | n/a | UID_GID_SUPPORT = False |
|---|
| 12 | n/a | |
|---|
| 13 | n/a | from shutil import get_archive_formats |
|---|
| 14 | n/a | from os.path import join |
|---|
| 15 | n/a | from packaging.dist import Distribution |
|---|
| 16 | n/a | from packaging.util import find_executable |
|---|
| 17 | n/a | from packaging.errors import PackagingOptionError |
|---|
| 18 | n/a | from packaging.command.sdist import sdist, show_formats |
|---|
| 19 | n/a | |
|---|
| 20 | n/a | from test.support import captured_stdout |
|---|
| 21 | n/a | from packaging.tests import support, unittest |
|---|
| 22 | n/a | from packaging.tests.support import requires_zlib |
|---|
| 23 | n/a | |
|---|
| 24 | n/a | |
|---|
| 25 | n/a | MANIFEST = """\ |
|---|
| 26 | n/a | # file GENERATED by packaging, do NOT edit |
|---|
| 27 | n/a | inroot.txt |
|---|
| 28 | n/a | setup.cfg |
|---|
| 29 | n/a | data%(sep)sdata.dt |
|---|
| 30 | n/a | scripts%(sep)sscript.py |
|---|
| 31 | n/a | some%(sep)sfile.txt |
|---|
| 32 | n/a | some%(sep)sother_file.txt |
|---|
| 33 | n/a | somecode%(sep)s__init__.py |
|---|
| 34 | n/a | somecode%(sep)sdoc.dat |
|---|
| 35 | n/a | somecode%(sep)sdoc.txt |
|---|
| 36 | n/a | """ |
|---|
| 37 | n/a | |
|---|
| 38 | n/a | |
|---|
| 39 | n/a | def builder(dist, filelist): |
|---|
| 40 | n/a | filelist.append('bah') |
|---|
| 41 | n/a | |
|---|
| 42 | n/a | |
|---|
| 43 | n/a | class SDistTestCase(support.TempdirManager, |
|---|
| 44 | n/a | support.LoggingCatcher, |
|---|
| 45 | n/a | support.EnvironRestorer, |
|---|
| 46 | n/a | unittest.TestCase): |
|---|
| 47 | n/a | |
|---|
| 48 | n/a | restore_environ = ['HOME'] |
|---|
| 49 | n/a | |
|---|
| 50 | n/a | def setUp(self): |
|---|
| 51 | n/a | super(SDistTestCase, self).setUp() |
|---|
| 52 | n/a | self.tmp_dir = self.mkdtemp() |
|---|
| 53 | n/a | os.environ['HOME'] = self.tmp_dir |
|---|
| 54 | n/a | # setting up an environment |
|---|
| 55 | n/a | self.old_path = os.getcwd() |
|---|
| 56 | n/a | os.mkdir(join(self.tmp_dir, 'somecode')) |
|---|
| 57 | n/a | os.mkdir(join(self.tmp_dir, 'dist')) |
|---|
| 58 | n/a | # a package, and a README |
|---|
| 59 | n/a | self.write_file((self.tmp_dir, 'README'), 'xxx') |
|---|
| 60 | n/a | self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#') |
|---|
| 61 | n/a | os.chdir(self.tmp_dir) |
|---|
| 62 | n/a | |
|---|
| 63 | n/a | def tearDown(self): |
|---|
| 64 | n/a | # back to normal |
|---|
| 65 | n/a | os.chdir(self.old_path) |
|---|
| 66 | n/a | super(SDistTestCase, self).tearDown() |
|---|
| 67 | n/a | |
|---|
| 68 | n/a | def get_cmd(self, metadata=None): |
|---|
| 69 | n/a | """Returns a cmd""" |
|---|
| 70 | n/a | if metadata is None: |
|---|
| 71 | n/a | metadata = {'name': 'fake', 'version': '1.0', |
|---|
| 72 | n/a | 'home_page': 'xxx', 'author': 'xxx', |
|---|
| 73 | n/a | 'author_email': 'xxx'} |
|---|
| 74 | n/a | dist = Distribution(metadata) |
|---|
| 75 | n/a | dist.packages = ['somecode'] |
|---|
| 76 | n/a | cmd = sdist(dist) |
|---|
| 77 | n/a | cmd.dist_dir = 'dist' |
|---|
| 78 | n/a | return dist, cmd |
|---|
| 79 | n/a | |
|---|
| 80 | n/a | @requires_zlib |
|---|
| 81 | n/a | def test_prune_file_list(self): |
|---|
| 82 | n/a | # this test creates a package with some vcs dirs in it |
|---|
| 83 | n/a | # and launch sdist to make sure they get pruned |
|---|
| 84 | n/a | # on all systems |
|---|
| 85 | n/a | |
|---|
| 86 | n/a | # creating VCS directories with some files in them |
|---|
| 87 | n/a | os.mkdir(join(self.tmp_dir, 'somecode', '.svn')) |
|---|
| 88 | n/a | self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx') |
|---|
| 89 | n/a | |
|---|
| 90 | n/a | os.mkdir(join(self.tmp_dir, 'somecode', '.hg')) |
|---|
| 91 | n/a | self.write_file((self.tmp_dir, 'somecode', '.hg', |
|---|
| 92 | n/a | 'ok'), 'xxx') |
|---|
| 93 | n/a | |
|---|
| 94 | n/a | os.mkdir(join(self.tmp_dir, 'somecode', '.git')) |
|---|
| 95 | n/a | self.write_file((self.tmp_dir, 'somecode', '.git', |
|---|
| 96 | n/a | 'ok'), 'xxx') |
|---|
| 97 | n/a | |
|---|
| 98 | n/a | # now building a sdist |
|---|
| 99 | n/a | dist, cmd = self.get_cmd() |
|---|
| 100 | n/a | |
|---|
| 101 | n/a | # zip is available universally |
|---|
| 102 | n/a | # (tar might not be installed under win32) |
|---|
| 103 | n/a | cmd.formats = ['zip'] |
|---|
| 104 | n/a | |
|---|
| 105 | n/a | cmd.ensure_finalized() |
|---|
| 106 | n/a | cmd.run() |
|---|
| 107 | n/a | |
|---|
| 108 | n/a | # now let's check what we have |
|---|
| 109 | n/a | dist_folder = join(self.tmp_dir, 'dist') |
|---|
| 110 | n/a | files = os.listdir(dist_folder) |
|---|
| 111 | n/a | self.assertEqual(files, ['fake-1.0.zip']) |
|---|
| 112 | n/a | |
|---|
| 113 | n/a | with zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) as zip_file: |
|---|
| 114 | n/a | content = zip_file.namelist() |
|---|
| 115 | n/a | |
|---|
| 116 | n/a | # making sure everything has been pruned correctly |
|---|
| 117 | n/a | self.assertEqual(len(content), 2) |
|---|
| 118 | n/a | |
|---|
| 119 | n/a | @requires_zlib |
|---|
| 120 | n/a | @unittest.skipIf(find_executable('tar') is None or |
|---|
| 121 | n/a | find_executable('gzip') is None, |
|---|
| 122 | n/a | 'requires tar and gzip programs') |
|---|
| 123 | n/a | def test_make_distribution(self): |
|---|
| 124 | n/a | # building a sdist |
|---|
| 125 | n/a | dist, cmd = self.get_cmd() |
|---|
| 126 | n/a | |
|---|
| 127 | n/a | # creating a gztar then a tar |
|---|
| 128 | n/a | cmd.formats = ['gztar', 'tar'] |
|---|
| 129 | n/a | cmd.ensure_finalized() |
|---|
| 130 | n/a | cmd.run() |
|---|
| 131 | n/a | |
|---|
| 132 | n/a | # making sure we have two files |
|---|
| 133 | n/a | dist_folder = join(self.tmp_dir, 'dist') |
|---|
| 134 | n/a | result = sorted(os.listdir(dist_folder)) |
|---|
| 135 | n/a | self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) |
|---|
| 136 | n/a | |
|---|
| 137 | n/a | os.remove(join(dist_folder, 'fake-1.0.tar')) |
|---|
| 138 | n/a | os.remove(join(dist_folder, 'fake-1.0.tar.gz')) |
|---|
| 139 | n/a | |
|---|
| 140 | n/a | # now trying a tar then a gztar |
|---|
| 141 | n/a | cmd.formats = ['tar', 'gztar'] |
|---|
| 142 | n/a | cmd.finalized = False |
|---|
| 143 | n/a | cmd.ensure_finalized() |
|---|
| 144 | n/a | cmd.run() |
|---|
| 145 | n/a | |
|---|
| 146 | n/a | result = sorted(os.listdir(dist_folder)) |
|---|
| 147 | n/a | self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) |
|---|
| 148 | n/a | |
|---|
| 149 | n/a | @requires_zlib |
|---|
| 150 | n/a | def test_add_defaults(self): |
|---|
| 151 | n/a | |
|---|
| 152 | n/a | # http://bugs.python.org/issue2279 |
|---|
| 153 | n/a | |
|---|
| 154 | n/a | # add_default should also include |
|---|
| 155 | n/a | # data_files and package_data |
|---|
| 156 | n/a | dist, cmd = self.get_cmd() |
|---|
| 157 | n/a | |
|---|
| 158 | n/a | # filling data_files by pointing files |
|---|
| 159 | n/a | # in package_data |
|---|
| 160 | n/a | dist.package_data = {'': ['*.cfg', '*.dat'], |
|---|
| 161 | n/a | 'somecode': ['*.txt']} |
|---|
| 162 | n/a | self.write_file((self.tmp_dir, 'setup.cfg'), '#') |
|---|
| 163 | n/a | self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') |
|---|
| 164 | n/a | self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#') |
|---|
| 165 | n/a | |
|---|
| 166 | n/a | # adding some data in data_files |
|---|
| 167 | n/a | data_dir = join(self.tmp_dir, 'data') |
|---|
| 168 | n/a | os.mkdir(data_dir) |
|---|
| 169 | n/a | self.write_file((data_dir, 'data.dt'), '#') |
|---|
| 170 | n/a | some_dir = join(self.tmp_dir, 'some') |
|---|
| 171 | n/a | os.mkdir(some_dir) |
|---|
| 172 | n/a | self.write_file((self.tmp_dir, 'inroot.txt'), '#') |
|---|
| 173 | n/a | self.write_file((some_dir, 'file.txt'), '#') |
|---|
| 174 | n/a | self.write_file((some_dir, 'other_file.txt'), '#') |
|---|
| 175 | n/a | |
|---|
| 176 | n/a | dist.data_files = {'data/data.dt': '{appdata}/data.dt', |
|---|
| 177 | n/a | 'inroot.txt': '{appdata}/inroot.txt', |
|---|
| 178 | n/a | 'some/file.txt': '{appdata}/file.txt', |
|---|
| 179 | n/a | 'some/other_file.txt': '{appdata}/other_file.txt'} |
|---|
| 180 | n/a | |
|---|
| 181 | n/a | # adding a script |
|---|
| 182 | n/a | script_dir = join(self.tmp_dir, 'scripts') |
|---|
| 183 | n/a | os.mkdir(script_dir) |
|---|
| 184 | n/a | self.write_file((script_dir, 'script.py'), '#') |
|---|
| 185 | n/a | dist.scripts = [join('scripts', 'script.py')] |
|---|
| 186 | n/a | |
|---|
| 187 | n/a | cmd.formats = ['zip'] |
|---|
| 188 | n/a | cmd.use_defaults = True |
|---|
| 189 | n/a | |
|---|
| 190 | n/a | cmd.ensure_finalized() |
|---|
| 191 | n/a | cmd.run() |
|---|
| 192 | n/a | |
|---|
| 193 | n/a | # now let's check what we have |
|---|
| 194 | n/a | dist_folder = join(self.tmp_dir, 'dist') |
|---|
| 195 | n/a | files = os.listdir(dist_folder) |
|---|
| 196 | n/a | self.assertEqual(files, ['fake-1.0.zip']) |
|---|
| 197 | n/a | |
|---|
| 198 | n/a | with zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip')) as zip_file: |
|---|
| 199 | n/a | content = zip_file.namelist() |
|---|
| 200 | n/a | |
|---|
| 201 | n/a | # Making sure everything was added. This includes 8 code and data |
|---|
| 202 | n/a | # files in addition to PKG-INFO and setup.cfg |
|---|
| 203 | n/a | self.assertEqual(len(content), 10) |
|---|
| 204 | n/a | |
|---|
| 205 | n/a | # Checking the MANIFEST |
|---|
| 206 | n/a | with open(join(self.tmp_dir, 'MANIFEST')) as fp: |
|---|
| 207 | n/a | manifest = fp.read() |
|---|
| 208 | n/a | self.assertEqual(manifest, MANIFEST % {'sep': os.sep}) |
|---|
| 209 | n/a | |
|---|
| 210 | n/a | @requires_zlib |
|---|
| 211 | n/a | def test_metadata_check_option(self): |
|---|
| 212 | n/a | # testing the `check-metadata` option |
|---|
| 213 | n/a | dist, cmd = self.get_cmd(metadata={'name': 'xxx', 'version': 'xxx'}) |
|---|
| 214 | n/a | |
|---|
| 215 | n/a | # this should cause the check subcommand to log two warnings: |
|---|
| 216 | n/a | # version is invalid, home-page and author are missing |
|---|
| 217 | n/a | cmd.ensure_finalized() |
|---|
| 218 | n/a | cmd.run() |
|---|
| 219 | n/a | warnings = self.get_logs() |
|---|
| 220 | n/a | check_warnings = [msg for msg in warnings if |
|---|
| 221 | n/a | not msg.startswith('sdist:')] |
|---|
| 222 | n/a | self.assertEqual(len(check_warnings), 2, warnings) |
|---|
| 223 | n/a | |
|---|
| 224 | n/a | # trying with a complete set of metadata |
|---|
| 225 | n/a | self.loghandler.flush() |
|---|
| 226 | n/a | dist, cmd = self.get_cmd() |
|---|
| 227 | n/a | cmd.ensure_finalized() |
|---|
| 228 | n/a | cmd.metadata_check = False |
|---|
| 229 | n/a | cmd.run() |
|---|
| 230 | n/a | warnings = self.get_logs() |
|---|
| 231 | n/a | self.assertEqual(len(warnings), 2) |
|---|
| 232 | n/a | self.assertIn('using default file list', warnings[0]) |
|---|
| 233 | n/a | self.assertIn("'setup.cfg' file not found", warnings[1]) |
|---|
| 234 | n/a | |
|---|
| 235 | n/a | def test_show_formats(self): |
|---|
| 236 | n/a | with captured_stdout() as stdout: |
|---|
| 237 | n/a | show_formats() |
|---|
| 238 | n/a | stdout = stdout.getvalue() |
|---|
| 239 | n/a | |
|---|
| 240 | n/a | # the output should be a header line + one line per format |
|---|
| 241 | n/a | num_formats = len(get_archive_formats()) |
|---|
| 242 | n/a | output = [line for line in stdout.split('\n') |
|---|
| 243 | n/a | if line.strip().startswith('--formats=')] |
|---|
| 244 | n/a | self.assertEqual(len(output), num_formats) |
|---|
| 245 | n/a | |
|---|
| 246 | n/a | def test_finalize_options(self): |
|---|
| 247 | n/a | dist, cmd = self.get_cmd() |
|---|
| 248 | n/a | cmd.finalize_options() |
|---|
| 249 | n/a | |
|---|
| 250 | n/a | # default options set by finalize |
|---|
| 251 | n/a | self.assertEqual(cmd.manifest, 'MANIFEST') |
|---|
| 252 | n/a | self.assertEqual(cmd.dist_dir, 'dist') |
|---|
| 253 | n/a | |
|---|
| 254 | n/a | # formats has to be a string splitable on (' ', ',') or |
|---|
| 255 | n/a | # a stringlist |
|---|
| 256 | n/a | cmd.formats = 1 |
|---|
| 257 | n/a | self.assertRaises(PackagingOptionError, cmd.finalize_options) |
|---|
| 258 | n/a | cmd.formats = ['zip'] |
|---|
| 259 | n/a | cmd.finalize_options() |
|---|
| 260 | n/a | |
|---|
| 261 | n/a | # formats has to be known |
|---|
| 262 | n/a | cmd.formats = 'supazipa' |
|---|
| 263 | n/a | self.assertRaises(PackagingOptionError, cmd.finalize_options) |
|---|
| 264 | n/a | |
|---|
| 265 | n/a | @requires_zlib |
|---|
| 266 | n/a | def test_template(self): |
|---|
| 267 | n/a | dist, cmd = self.get_cmd() |
|---|
| 268 | n/a | dist.extra_files = ['include yeah'] |
|---|
| 269 | n/a | cmd.ensure_finalized() |
|---|
| 270 | n/a | self.write_file((self.tmp_dir, 'yeah'), 'xxx') |
|---|
| 271 | n/a | cmd.run() |
|---|
| 272 | n/a | with open(cmd.manifest) as f: |
|---|
| 273 | n/a | content = f.read() |
|---|
| 274 | n/a | |
|---|
| 275 | n/a | self.assertIn('yeah', content) |
|---|
| 276 | n/a | |
|---|
| 277 | n/a | @requires_zlib |
|---|
| 278 | n/a | @unittest.skipUnless(UID_GID_SUPPORT, "requires grp and pwd support") |
|---|
| 279 | n/a | @unittest.skipIf(find_executable('tar') is None or |
|---|
| 280 | n/a | find_executable('gzip') is None, |
|---|
| 281 | n/a | 'requires tar and gzip programs') |
|---|
| 282 | n/a | def test_make_distribution_owner_group(self): |
|---|
| 283 | n/a | # building a sdist |
|---|
| 284 | n/a | dist, cmd = self.get_cmd() |
|---|
| 285 | n/a | |
|---|
| 286 | n/a | # creating a gztar and specifying the owner+group |
|---|
| 287 | n/a | cmd.formats = ['gztar'] |
|---|
| 288 | n/a | cmd.owner = pwd.getpwuid(0)[0] |
|---|
| 289 | n/a | cmd.group = grp.getgrgid(0)[0] |
|---|
| 290 | n/a | cmd.ensure_finalized() |
|---|
| 291 | n/a | cmd.run() |
|---|
| 292 | n/a | |
|---|
| 293 | n/a | # making sure we have the good rights |
|---|
| 294 | n/a | archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz') |
|---|
| 295 | n/a | with tarfile.open(archive_name) as archive: |
|---|
| 296 | n/a | for member in archive.getmembers(): |
|---|
| 297 | n/a | self.assertEqual(member.uid, 0) |
|---|
| 298 | n/a | self.assertEqual(member.gid, 0) |
|---|
| 299 | n/a | |
|---|
| 300 | n/a | # building a sdist again |
|---|
| 301 | n/a | dist, cmd = self.get_cmd() |
|---|
| 302 | n/a | |
|---|
| 303 | n/a | # creating a gztar |
|---|
| 304 | n/a | cmd.formats = ['gztar'] |
|---|
| 305 | n/a | cmd.ensure_finalized() |
|---|
| 306 | n/a | cmd.run() |
|---|
| 307 | n/a | |
|---|
| 308 | n/a | # making sure we have the good rights |
|---|
| 309 | n/a | archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz') |
|---|
| 310 | n/a | with tarfile.open(archive_name) as archive: |
|---|
| 311 | n/a | |
|---|
| 312 | n/a | # note that we are not testing the group ownership here |
|---|
| 313 | n/a | # because, depending on the platforms and the container |
|---|
| 314 | n/a | # rights (see #7408) |
|---|
| 315 | n/a | for member in archive.getmembers(): |
|---|
| 316 | n/a | self.assertEqual(member.uid, os.getuid()) |
|---|
| 317 | n/a | |
|---|
| 318 | n/a | @requires_zlib |
|---|
| 319 | n/a | def test_get_file_list(self): |
|---|
| 320 | n/a | # make sure MANIFEST is recalculated |
|---|
| 321 | n/a | dist, cmd = self.get_cmd() |
|---|
| 322 | n/a | # filling data_files by pointing files in package_data |
|---|
| 323 | n/a | dist.package_data = {'somecode': ['*.txt']} |
|---|
| 324 | n/a | self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#') |
|---|
| 325 | n/a | cmd.ensure_finalized() |
|---|
| 326 | n/a | cmd.run() |
|---|
| 327 | n/a | |
|---|
| 328 | n/a | # Should produce four lines. Those lines are one comment, one default |
|---|
| 329 | n/a | # (README) and two package files. |
|---|
| 330 | n/a | with open(cmd.manifest) as f: |
|---|
| 331 | n/a | manifest = [line.strip() for line in f.read().split('\n') |
|---|
| 332 | n/a | if line.strip() != ''] |
|---|
| 333 | n/a | self.assertEqual(len(manifest), 3) |
|---|
| 334 | n/a | |
|---|
| 335 | n/a | # Adding a file |
|---|
| 336 | n/a | self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#') |
|---|
| 337 | n/a | |
|---|
| 338 | n/a | # make sure build_py is reinitialized, like a fresh run |
|---|
| 339 | n/a | build_py = dist.get_command_obj('build_py') |
|---|
| 340 | n/a | build_py.finalized = False |
|---|
| 341 | n/a | build_py.ensure_finalized() |
|---|
| 342 | n/a | |
|---|
| 343 | n/a | cmd.run() |
|---|
| 344 | n/a | |
|---|
| 345 | n/a | with open(cmd.manifest) as f: |
|---|
| 346 | n/a | manifest2 = [line.strip() for line in f.read().split('\n') |
|---|
| 347 | n/a | if line.strip() != ''] |
|---|
| 348 | n/a | |
|---|
| 349 | n/a | # Do we have the new file in MANIFEST? |
|---|
| 350 | n/a | self.assertEqual(len(manifest2), 4) |
|---|
| 351 | n/a | self.assertIn('doc2.txt', manifest2[-1]) |
|---|
| 352 | n/a | |
|---|
| 353 | n/a | @requires_zlib |
|---|
| 354 | n/a | def test_manifest_marker(self): |
|---|
| 355 | n/a | # check that autogenerated MANIFESTs have a marker |
|---|
| 356 | n/a | dist, cmd = self.get_cmd() |
|---|
| 357 | n/a | cmd.ensure_finalized() |
|---|
| 358 | n/a | cmd.run() |
|---|
| 359 | n/a | |
|---|
| 360 | n/a | with open(cmd.manifest) as f: |
|---|
| 361 | n/a | manifest = [line.strip() for line in f.read().split('\n') |
|---|
| 362 | n/a | if line.strip() != ''] |
|---|
| 363 | n/a | |
|---|
| 364 | n/a | self.assertEqual(manifest[0], |
|---|
| 365 | n/a | '# file GENERATED by packaging, do NOT edit') |
|---|
| 366 | n/a | |
|---|
| 367 | n/a | @requires_zlib |
|---|
| 368 | n/a | def test_manual_manifest(self): |
|---|
| 369 | n/a | # check that a MANIFEST without a marker is left alone |
|---|
| 370 | n/a | dist, cmd = self.get_cmd() |
|---|
| 371 | n/a | cmd.ensure_finalized() |
|---|
| 372 | n/a | self.write_file((self.tmp_dir, cmd.manifest), 'README.manual') |
|---|
| 373 | n/a | cmd.run() |
|---|
| 374 | n/a | |
|---|
| 375 | n/a | with open(cmd.manifest) as f: |
|---|
| 376 | n/a | manifest = [line.strip() for line in f.read().split('\n') |
|---|
| 377 | n/a | if line.strip() != ''] |
|---|
| 378 | n/a | |
|---|
| 379 | n/a | self.assertEqual(manifest, ['README.manual']) |
|---|
| 380 | n/a | |
|---|
| 381 | n/a | @requires_zlib |
|---|
| 382 | n/a | def test_manifest_builder(self): |
|---|
| 383 | n/a | dist, cmd = self.get_cmd() |
|---|
| 384 | n/a | cmd.manifest_builders = 'packaging.tests.test_command_sdist.builder' |
|---|
| 385 | n/a | cmd.ensure_finalized() |
|---|
| 386 | n/a | cmd.run() |
|---|
| 387 | n/a | self.assertIn('bah', cmd.filelist.files) |
|---|
| 388 | n/a | |
|---|
| 389 | n/a | |
|---|
| 390 | n/a | def test_suite(): |
|---|
| 391 | n/a | return unittest.makeSuite(SDistTestCase) |
|---|
| 392 | n/a | |
|---|
| 393 | n/a | if __name__ == "__main__": |
|---|
| 394 | n/a | unittest.main(defaultTest="test_suite") |
|---|