本文整理汇总了Python中pmaker.models.FileObjectFactory.create_from_real_object方法的典型用法代码示例。如果您正苦于以下问题:Python FileObjectFactory.create_from_real_object方法的具体用法?Python FileObjectFactory.create_from_real_object怎么用?Python FileObjectFactory.create_from_real_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pmaker.models.FileObjectFactory
的用法示例。
在下文中一共展示了FileObjectFactory.create_from_real_object方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__file_w_mode
# 需要导入模块: from pmaker.models import FileObjectFactory [as 别名]
# 或者: from pmaker.models.FileObjectFactory import create_from_real_object [as 别名]
def test__file_w_mode(self):
mode = "0600"
fo = B.Bunch(path=self.file, mode=mode)
fo = Factory.create_from_real_object(fo)
self.assertEquals(fo.mode, mode)
示例2: test__symlink_missing
# 需要导入模块: from pmaker.models import FileObjectFactory [as 别名]
# 或者: from pmaker.models.FileObjectFactory import create_from_real_object [as 别名]
def test__symlink_missing(self):
fo = B.Bunch(path=self.missinglink)
fo = Factory.create_from_real_object(fo)
self.assertTrue(isinstance(fo, FO.SymlinkObject))
self.assertEquals(fo.type(), G.TYPE_SYMLINK)
self.assertEquals(fo.path, self.missinglink)
示例3: test__dir_wo_metadata
# 需要导入模块: from pmaker.models import FileObjectFactory [as 别名]
# 或者: from pmaker.models.FileObjectFactory import create_from_real_object [as 别名]
def test__dir_wo_metadata(self):
fo = B.Bunch(path=self.dir)
fo = Factory.create_from_real_object(fo)
self.assertTrue(isinstance(fo, FO.DirObject))
self.assertEquals(fo.type(), G.TYPE_DIR)
self.assertEquals(fo.path, self.dir)
self.assertEquals(fo.mode, self.dir_mode)
示例4: test__file_wo_metadata
# 需要导入模块: from pmaker.models import FileObjectFactory [as 别名]
# 或者: from pmaker.models.FileObjectFactory import create_from_real_object [as 别名]
def test__file_wo_metadata(self):
fo = B.Bunch(path=self.file)
fo = Factory.create_from_real_object(fo)
self.assertTrue(isinstance(fo, FO.FileObject))
self.assertEquals(fo.type(), G.TYPE_FILE)
self.assertEquals(fo.path, self.file)
self.assertEquals(fo.mode, self.file_mode)
示例5: test__file_w_uid_and_gid
# 需要导入模块: from pmaker.models import FileObjectFactory [as 别名]
# 或者: from pmaker.models.FileObjectFactory import create_from_real_object [as 别名]
def test__file_w_uid_and_gid(self):
uid = 1
gid = 1
fo = B.Bunch(path=self.file, uid=uid, gid=gid)
fo = Factory.create_from_real_object(fo)
self.assertEquals(fo.uid, uid)
self.assertEquals(fo.gid, gid)
示例6: test__dir_w_mode
# 需要导入模块: from pmaker.models import FileObjectFactory [as 别名]
# 或者: from pmaker.models.FileObjectFactory import create_from_real_object [as 别名]
def test__dir_w_mode(self):
mode = "0700"
fo = B.Bunch(path=self.dir, mode=mode)
fo = Factory.create_from_real_object(fo)
self.assertTrue(isinstance(fo, FO.DirObject))
self.assertEquals(fo.type(), G.TYPE_DIR)
self.assertEquals(fo.path, self.dir)
self.assertEquals(fo.mode, mode)