本文整理汇总了Python中Base.Base.joinRootPath方法的典型用法代码示例。如果您正苦于以下问题:Python Base.joinRootPath方法的具体用法?Python Base.joinRootPath怎么用?Python Base.joinRootPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base.Base
的用法示例。
在下文中一共展示了Base.joinRootPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import joinRootPath [as 别名]
def test(self):
dir1 = Base.joinRootPath('MadeIt')
dir2 = Base.joinRootPath('SubA/SubB/SubC')
dir3 = Base.joinRootPath('SubX/SubY')
dir4 = Base.joinRootPath('SubX/SubZ')
dir5 = Base.joinRootPath('OriginA/MadeIt')
dir6 = Base.joinRootPath('OriginA/SubA/SubB/SubC')
dir7 = Base.joinRootPath('OriginA/SubX/SubY')
dir8 = Base.joinRootPath('OriginA/SubX/SubZ')
sut1 = Mkdir(Base.testDir, [dir1, dir2, dir3, dir4])
sut2 = Mkdir(Base.testDir, [dir5, dir6, dir7, dir8])
eq_(Base.isExists(dir1), False)
eq_(Base.isExists(dir2), False)
eq_(Base.isExists(dir3), False)
eq_(Base.isExists(dir4), False)
eq_(Base.isExists(dir5), False)
eq_(Base.isExists(dir6), False)
eq_(Base.isExists(dir7), False)
eq_(Base.isExists(dir8), False)
sut1.execute()
eq_(Base.isExists(dir1), True)
eq_(Base.isExists(dir2), True)
eq_(Base.isExists(dir3), True)
eq_(Base.isExists(dir4), True)
eq_(Base.isExists(dir5), False)
eq_(Base.isExists(dir6), False)
eq_(Base.isExists(dir7), False)
eq_(Base.isExists(dir8), False)
sut2.execute()
eq_(Base.isExists(dir1), True)
eq_(Base.isExists(dir2), True)
eq_(Base.isExists(dir3), True)
eq_(Base.isExists(dir4), True)
eq_(Base.isExists(dir5), True)
eq_(Base.isExists(dir6), True)
eq_(Base.isExists(dir7), True)
eq_(Base.isExists(dir8), True)
sut2.unexecute()
eq_(Base.isExists(dir1), True)
eq_(Base.isExists(dir2), True)
eq_(Base.isExists(dir3), True)
eq_(Base.isExists(dir4), True)
eq_(Base.isExists(dir5), False)
eq_(Base.isExists(dir6), False)
eq_(Base.isExists(dir7), False)
eq_(Base.isExists(dir8), False)
sut1.unexecute()
eq_(Base.isExists(dir1), False)
eq_(Base.isExists(dir2), False)
eq_(Base.isExists(dir3), False)
eq_(Base.isExists(dir4), False)
eq_(Base.isExists(dir5), False)
eq_(Base.isExists(dir6), False)
eq_(Base.isExists(dir7), False)
eq_(Base.isExists(dir8), False)
示例2: test
# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import joinRootPath [as 别名]
def test(self):
src1 = Base.joinRootPath('OriginA.txt')
dst1 = Base.joinTrashPath('OriginA.txt')
src2 = Base.joinRootPath('OriginA')
dst2 = Base.joinTrashPath('OriginA')
src3 = Base.joinRootPath('OriginX/OriginY.txt')
dst3 = Base.joinTrashPath('OriginY.txt')
src4 = Base.joinRootPath('OriginX/OriginY')
dst4 = Base.joinTrashPath('OriginY')
sut1 = Remove([src1, src2])
sut2 = Remove([src3, src4])
eq_(Base.isExists(src1), True)
eq_(Base.isExists(dst1), False)
eq_(Base.isExists(src2), True)
eq_(Base.isExists(dst2), False)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
sut1.execute()
eq_(Base.isExists(src1), False)
eq_(Base.isExists(dst1), True)
eq_(Base.isExists(src2), False)
eq_(Base.isExists(dst2), True)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
sut2.execute()
eq_(Base.isExists(src1), False)
eq_(Base.isExists(dst1), True)
eq_(Base.isExists(src2), False)
eq_(Base.isExists(dst2), True)
eq_(Base.isExists(src3), False)
eq_(Base.isExists(dst3), True)
eq_(Base.isExists(src4), False)
eq_(Base.isExists(dst4), True)
sut2.unexecute()
eq_(Base.isExists(src1), False)
eq_(Base.isExists(dst1), True)
eq_(Base.isExists(src2), False)
eq_(Base.isExists(dst2), True)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
sut1.unexecute()
eq_(Base.isExists(src1), True)
eq_(Base.isExists(dst1), False)
eq_(Base.isExists(src2), True)
eq_(Base.isExists(dst2), False)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
示例3: test
# 需要导入模块: from Base import Base [as 别名]
# 或者: from Base.Base import joinRootPath [as 别名]
def test(self):
pairPaths1 = []
pairPaths2 = []
src1 = Base.joinRootPath('OriginA.txt')
dst1 = Base.joinRootPath('OriginA_copied.txt')
pairPaths1.append(PairPath(src1, dst1))
src2 = Base.joinRootPath('OriginA')
dst2 = Base.joinRootPath('OriginA_copied')
pairPaths1.append(PairPath(src2, dst2))
src3 = Base.joinRootPath('OriginX/OriginY.txt')
dst3 = Base.joinRootPath('OriginX/OriginY_copied.txt')
pairPaths2.append(PairPath(src3, dst3))
src4 = Base.joinRootPath('OriginX/OriginY')
dst4 = Base.joinRootPath('OriginX/OriginY_copied')
pairPaths2.append(PairPath(src4, dst4))
sut1 = Copy(pairPaths1)
sut2 = Copy(pairPaths2)
eq_(Base.isExists(src1), True)
eq_(Base.isExists(dst1), False)
eq_(Base.isExists(src2), True)
eq_(Base.isExists(dst2), False)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
sut1.execute()
eq_(Base.isExists(src1), True)
eq_(Base.isExists(dst1), True)
eq_(Base.isExists(src2), True)
eq_(Base.isExists(dst2), True)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
sut2.execute()
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), True)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), True)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), True)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), True)
sut2.unexecute()
eq_(Base.isExists(src1), True)
eq_(Base.isExists(dst1), True)
eq_(Base.isExists(src2), True)
eq_(Base.isExists(dst2), True)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)
sut1.unexecute()
eq_(Base.isExists(src1), True)
eq_(Base.isExists(dst1), False)
eq_(Base.isExists(src2), True)
eq_(Base.isExists(dst2), False)
eq_(Base.isExists(src3), True)
eq_(Base.isExists(dst3), False)
eq_(Base.isExists(src4), True)
eq_(Base.isExists(dst4), False)