本文整理匯總了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))