cc-4105: fixed some bugs. fixed manager tests
This commit is contained in:
parent
ba78731f99
commit
f7b48a4dbb
9 changed files with 37 additions and 26 deletions
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import copy
|
||||
import os
|
||||
from os.path import normpath
|
||||
import shutil
|
||||
import sys
|
||||
import hashlib
|
||||
|
@ -328,6 +329,11 @@ def create_dir(path):
|
|||
else: # if no error occurs we still need to check that dir exists
|
||||
if not os.path.exists: raise FailedToCreateDir(path)
|
||||
|
||||
def sub_path(directory,f):
|
||||
normalized = normpath(directory)
|
||||
common = os.path.commonprefix([ directory, normpath(f) ])
|
||||
return common == normalized
|
||||
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue