python类is_sh()的实例源码

test_resources.py 文件源码 项目:dymo-m10-python 作者: pbrf 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def test_get_script_header(self):
        if not sys.platform.startswith('java') or not is_sh(sys.executable):
            # This test is for non-Jython platforms
            self.assertEqual(get_script_header('#!/usr/local/bin/python'),
                             '#!%s\n' % os.path.normpath(sys.executable))
            self.assertEqual(get_script_header('#!/usr/bin/python -x'),
                             '#!%s  -x\n' % os.path.normpath(sys.executable))
            self.assertEqual(get_script_header('#!/usr/bin/python',
                                               executable=self.non_ascii_exe),
                             '#!%s -x\n' % self.non_ascii_exe)


问题


面经


文章

微信
公众号

扫码关注公众号