diff options
Diffstat (limited to 'distutils2/tests/test_command_sdist.py')
| -rw-r--r-- | distutils2/tests/test_command_sdist.py | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/distutils2/tests/test_command_sdist.py b/distutils2/tests/test_command_sdist.py index 04e98fe..f43e6cc 100644 --- a/distutils2/tests/test_command_sdist.py +++ b/distutils2/tests/test_command_sdist.py @@ -45,7 +45,6 @@ setup(name='fake') MANIFEST = """\ # file GENERATED by distutils, do NOT edit -README inroot.txt data%(sep)sdata.dt scripts%(sep)sscript.py @@ -96,9 +95,6 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, dist.include_package_data = True cmd = sdist(dist) cmd.dist_dir = 'dist' - def _warn(*args): - pass - cmd.warn = _warn return dist, cmd @unittest.skipUnless(zlib, "requires zlib") @@ -141,7 +137,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, zip_file.close() # making sure everything has been pruned correctly - self.assertEqual(len(content), 3) + self.assertEqual(len(content), 2) @unittest.skipUnless(zlib, "requires zlib") def test_make_distribution(self): @@ -206,11 +202,10 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, self.write_file((some_dir, 'file.txt'), '#') self.write_file((some_dir, 'other_file.txt'), '#') - dist.data_files = [('data', ['data/data.dt', - 'inroot.txt', - 'notexisting']), - 'some/file.txt', - 'some/other_file.txt'] + dist.data_files = {'data/data.dt' : '{appdata}/data.dt', + 'inroot.txt' : '{appdata}/inroot.txt', + 'some/file.txt' : '{appdata}/file.txt', + 'some/other_file.txt' : '{appdata}/other_file.txt'} # adding a script script_dir = join(self.tmp_dir, 'scripts') @@ -236,7 +231,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, zip_file.close() # making sure everything was added - self.assertEqual(len(content), 10) + self.assertEqual(len(content), 9) # checking the MANIFEST manifest = open(join(self.tmp_dir, 'MANIFEST')).read() @@ -245,14 +240,14 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, @unittest.skipUnless(zlib, "requires zlib") def test_metadata_check_option(self): # testing the `check-metadata` option - dist, cmd = self.get_cmd(metadata={}) + dist, cmd = self.get_cmd(metadata={'name':'xxx', 'version':'xxx'}) # this should raise some warnings ! # with the `check` subcommand cmd.ensure_finalized() cmd.run() warnings = self.get_logs(logging.WARN) - self.assertEqual(len(warnings), 1) + self.assertEqual(len(warnings), 2) # trying with a complete set of metadata self.clear_logs() @@ -264,7 +259,8 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, # removing manifest generated warnings warnings = [warn for warn in warnings if not warn.endswith('-- skipping')] - self.assertEqual(len(warnings), 0) + # the remaining warning is about the use of the default file list + self.assertEqual(len(warnings), 1) def test_show_formats(self): @@ -362,8 +358,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, if line.strip() != ''] finally: f.close() - - self.assertEquals(len(manifest), 4) + self.assertEqual(len(manifest), 3) # adding a file self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#') @@ -383,7 +378,7 @@ class SDistTestCase(support.TempdirManager, support.LoggingCatcher, f.close() # do we have the new file in MANIFEST ? - self.assertEquals(len(manifest2), 5) + self.assertEqual(len(manifest2), 4) self.assertIn('doc2.txt', manifest2[-1]) def test_manifest_marker(self): |
