本文整理汇总了Python中elodie.filesystem.FileSystem.create_directory方法的典型用法代码示例。如果您正苦于以下问题:Python FileSystem.create_directory方法的具体用法?Python FileSystem.create_directory怎么用?Python FileSystem.create_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elodie.filesystem.FileSystem
的用法示例。
在下文中一共展示了FileSystem.create_directory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_directory_invalid_permissions
# 需要导入模块: from elodie.filesystem import FileSystem [as 别名]
# 或者: from elodie.filesystem.FileSystem import create_directory [as 别名]
def test_create_directory_invalid_permissions():
if os.name == 'nt':
raise SkipTest("It isn't implemented on Windows")
filesystem = FileSystem()
status = filesystem.create_directory('/apathwhichdoesnotexist/afolderwhichdoesnotexist')
assert status == False
示例2: test_create_directory_invalid_permissions
# 需要导入模块: from elodie.filesystem import FileSystem [as 别名]
# 或者: from elodie.filesystem.FileSystem import create_directory [as 别名]
def test_create_directory_invalid_permissions(mock_makedirs):
if os.name == 'nt':
raise SkipTest("It isn't implemented on Windows")
# Mock the case where makedirs raises an OSError because the user does
# not have permission to create the given directory.
mock_makedirs.side_effect = OSError()
filesystem = FileSystem()
status = filesystem.create_directory('/apathwhichdoesnotexist/afolderwhichdoesnotexist')
assert status == False
示例3: test_create_directory_recursive_success
# 需要导入模块: from elodie.filesystem import FileSystem [as 别名]
# 或者: from elodie.filesystem.FileSystem import create_directory [as 别名]
def test_create_directory_recursive_success():
filesystem = FileSystem()
folder = '%s/%s/%s' % (helper.temp_dir(), helper.random_string(10), helper.random_string(10))
status = filesystem.create_directory(folder)
# Needs to be a subdirectory
assert helper.temp_dir() != folder
assert status == True
assert os.path.isdir(folder) == True
assert os.path.exists(folder) == True
shutil.rmtree(folder)
示例4: test_create_directory_invalid_permissions
# 需要导入模块: from elodie.filesystem import FileSystem [as 别名]
# 或者: from elodie.filesystem.FileSystem import create_directory [as 别名]
def test_create_directory_invalid_permissions():
filesystem = FileSystem()
status = filesystem.create_directory('/apathwhichdoesnotexist/afolderwhichdoesnotexist')
assert status == False