当前位置: 首页>>代码示例>>Python>>正文


Python FileObjectFactory.create_from_real_object方法代码示例

本文整理汇总了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)
开发者ID:ssato,项目名称:packagemaker,代码行数:9,代码来源:FileObjectFactory.py

示例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)
开发者ID:ssato,项目名称:packagemaker,代码行数:9,代码来源:FileObjectFactory.py

示例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)
开发者ID:ssato,项目名称:packagemaker,代码行数:10,代码来源:FileObjectFactory.py

示例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)
开发者ID:ssato,项目名称:packagemaker,代码行数:10,代码来源:FileObjectFactory.py

示例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)
开发者ID:ssato,项目名称:packagemaker,代码行数:11,代码来源:FileObjectFactory.py

示例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)
开发者ID:ssato,项目名称:packagemaker,代码行数:12,代码来源:FileObjectFactory.py


注:本文中的pmaker.models.FileObjectFactory.create_from_real_object方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。