test_sdist.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:facebook-face-recognition 作者: mathur 项目源码 文件源码
def test_defaults_case_sensitivity(self):
        """
            Make sure default files (README.*, etc.) are added in a case-sensitive
            way to avoid problems with packages built on Windows.
        """

        open(os.path.join(self.temp_dir, 'readme.rst'), 'w').close()
        open(os.path.join(self.temp_dir, 'SETUP.cfg'), 'w').close()

        dist = Distribution(SETUP_ATTRS)
        # the extension deliberately capitalized for this test
        # to make sure the actual filename (not capitalized) gets added
        # to the manifest
        dist.script_name = 'setup.PY'
        cmd = sdist(dist)
        cmd.ensure_finalized()

        with quiet():
            cmd.run()

        # lowercase all names so we can test in a case-insensitive way to make sure the files are not included
        manifest = map(lambda x: x.lower(), cmd.filelist.files)
        assert 'readme.rst' not in manifest, manifest
        assert 'setup.py' not in manifest, manifest
        assert 'setup.cfg' not in manifest, manifest
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号