def test_empty_package_dir(self): # See SF 1668596/1720897. # create the distribution files. sources = self.mkdtemp() pkg = os.path.join(sources, 'pkg') os.mkdir(pkg) open(os.path.join(pkg, "__init__.py"), "wb").close() testdir = os.path.join(pkg, "doc") os.mkdir(testdir) open(os.path.join(testdir, "testfile"), "wb").close() os.chdir(sources) dist = Distribution({ "packages": ["pkg"], "package_dir": sources, "package_data": { "pkg": ["doc/*"] } }) dist.script_args = ["build"] dist.parse_command_line() try: dist.run_commands() except PackagingFileError: self.fail("failed package_data test when package_dir is ''")
def test_empty_package_dir(self): # See SF 1668596/1720897. # create the distribution files. sources = self.mkdtemp() pkg = os.path.join(sources, 'pkg') os.mkdir(pkg) open(os.path.join(pkg, "__init__.py"), "wb").close() testdir = os.path.join(pkg, "doc") os.mkdir(testdir) open(os.path.join(testdir, "testfile"), "wb").close() os.chdir(sources) dist = Distribution({"packages": ["pkg"], "package_dir": sources, "package_data": {"pkg": ["doc/*"]}}) dist.script_args = ["build"] dist.parse_command_line() try: dist.run_commands() except PackagingFileError: self.fail("failed package_data test when package_dir is ''")