本文整理汇总了Python中macostools.mkalias方法的典型用法代码示例。如果您正苦于以下问题:Python macostools.mkalias方法的具体用法?Python macostools.mkalias怎么用?Python macostools.mkalias使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类macostools
的用法示例。
在下文中一共展示了macostools.mkalias方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mkalias
# 需要导入模块: import macostools [as 别名]
# 或者: from macostools import mkalias [as 别名]
def test_mkalias(self):
test_support.unlink(TESTFN2)
macostools.mkalias(test_support.TESTFN, TESTFN2)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
示例2: test_mkalias_relative
# 需要导入模块: import macostools [as 别名]
# 或者: from macostools import mkalias [as 别名]
def test_mkalias_relative(self):
test_support.unlink(TESTFN2)
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
示例3: test_mkalias
# 需要导入模块: import macostools [as 别名]
# 或者: from macostools import mkalias [as 别名]
def test_mkalias(self):
test_support.unlink(TESTFN2)
macostools.mkalias(test_support.TESTFN, TESTFN2)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
示例4: test_mkalias_relative
# 需要导入模块: import macostools [as 别名]
# 或者: from macostools import mkalias [as 别名]
def test_mkalias_relative(self):
test_support.unlink(TESTFN2)
# If the directory doesn't exist, then chances are this is a new
# install of Python so don't create it since the user might end up
# running ``sudo make install`` and creating the directory here won't
# leave it with the proper permissions.
if not os.path.exists(sys.prefix):
return
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
示例5: test_mkalias
# 需要导入模块: import macostools [as 别名]
# 或者: from macostools import mkalias [as 别名]
def test_mkalias(self):
try:
os.unlink(TESTFN2)
except:
pass
macostools.mkalias(test_support.TESTFN, TESTFN2)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))
示例6: test_mkalias_relative
# 需要导入模块: import macostools [as 别名]
# 或者: from macostools import mkalias [as 别名]
def test_mkalias_relative(self):
try:
os.unlink(TESTFN2)
except:
pass
# If the directory doesn't exist, then chances are this is a new
# install of Python so don't create it since the user might end up
# running ``sudo make install`` and creating the directory here won't
# leave it with the proper permissions.
if not os.path.exists(sys.prefix):
return
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
fss, _, _ = Carbon.File.ResolveAliasFile(TESTFN2, 0)
self.assertEqual(fss.as_pathname(), os.path.realpath(test_support.TESTFN))