當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。