本文整理汇总了Python中snapshot.Snapshot.create方法的典型用法代码示例。如果您正苦于以下问题:Python Snapshot.create方法的具体用法?Python Snapshot.create怎么用?Python Snapshot.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类snapshot.Snapshot
的用法示例。
在下文中一共展示了Snapshot.create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_snapshot
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import create [as 别名]
def create_snapshot(self, file):
if not file:
self.logger.info("Please enter a valid filename.")
return None
s = Snapshot(file)
s.create()
示例2: _test_create
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import create [as 别名]
def _test_create(my):
search = Search("unittest/person")
persons = search.get_sobjects()
person = persons[0]
snapshot_type = "file"
snapshot = Snapshot.create(person, context="publish", snapshot_type=snapshot_type)
version = snapshot.get_value("version")
my.assertEquals( 1, version )
search_type = snapshot.get_value("search_type")
my.assertEquals( search_type, person.get_search_type() )
search_code = snapshot.get_value("search_code")
my.assertEquals( search_code, person.get_value("code") )
# also check search_id
if SearchType.column_exists("sthpw/snapshot", "search_id"):
search_code = snapshot.get_value("search_id")
my.assertEquals( search_code, person.get_value("id") )
test_person = snapshot.get_sobject()
my.assertEquals(test_person.get_code(), person.get_code())
示例3: test_init
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import create [as 别名]
def test_init(self):
s = Snapshot('./', 'index.sqlite', './snapshots_t/')
s.create()
s.create()
print "Latest %s" % s.replaceWithLatest()