--- a/Lib/packaging/tests/test_command_install_data.py Sat Jun 09 17:31:59 2012 +0100 +++ b/Lib/packaging/tests/test_command_install_data.py Mon May 21 23:01:17 2012 -0400 @@ -95,10 +95,12 @@ scripts_dir = self.mkdtemp() project_dir, dist = self.create_dist( name='Spamlib', version='0.1', - data_files={'spamd': '{scripts}/spamd'}) + data_files={'spamd': '{scripts}/spamd', + 'entry_points.txt': '{dist-info}/entry_points.txt'}) os.chdir(project_dir) self.write_file('spamd', '# Python script') + self.write_file('entry_points.txt', '[entry_points]\nham = eggs:cheese') sysconfig._SCHEMES.set(_get_default_scheme(), 'scripts', scripts_dir) sys.path.insert(0, install_dir) packaging.database.disable_cache() @@ -119,18 +121,21 @@ cmd = install_distinfo(dist) cmd.ensure_finalized() dist.command_obj['install_distinfo'] = cmd - cmd.run() + cmd.run() # first a few sanity checks self.assertEqual(os.listdir(scripts_dir), ['spamd']) - self.assertEqual(os.listdir(install_dir), ['Spamlib-0.1.dist-info']) + self.assertEqual(os.listdir(install_dir), ['Spamlib-0.1.dist-info']) # now the real test fn = os.path.join(install_dir, 'Spamlib-0.1.dist-info', 'RESOURCES') with open(fn, encoding='utf-8') as fp: content = fp.read().strip() - expected = 'spamd,%s' % os.path.join(scripts_dir, 'spamd') + expected = 'spamd,%s\nentry_points.txt,%s' % (os.path.join(scripts_dir, 'spamd'), + os.path.join(install_dir, + 'Spamlib-0.1.dist-info', + 'entry_points.txt')) self.assertEqual(content, expected) # just to be sure, we also test that get_file works here, even though