本文整理匯總了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)