本文整理汇总了Python中couchbase.cluster.Cluster.delete_view方法的典型用法代码示例。如果您正苦于以下问题:Python Cluster.delete_view方法的具体用法?Python Cluster.delete_view怎么用?Python Cluster.delete_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类couchbase.cluster.Cluster
的用法示例。
在下文中一共展示了Cluster.delete_view方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_delete_similar_views
# 需要导入模块: from couchbase.cluster import Cluster [as 别名]
# 或者: from couchbase.cluster.Cluster import delete_view [as 别名]
def test_create_delete_similar_views(self):
ddoc_name_prefix = self.input.param("ddoc_name_prefix", "ddoc")
view_name = self.input.param("view_name", "test_view")
map_fn = 'function (doc) {if(doc.age !== undefined) { emit(doc.age, doc.name);}}'
rest = RestConnection(self.servers[0])
ddocs = [DesignDocument(ddoc_name_prefix + "1", [View(view_name, map_fn,
dev_view=False)],
options={"updateMinChanges":0, "replicaUpdateMinChanges":0}),
DesignDocument(ddoc_name_prefix + "2", [View(view_name, map_fn,
dev_view=True)],
options={"updateMinChanges":0, "replicaUpdateMinChanges":0})]
ViewBaseTests._load_docs(self, self.num_docs, "test_")
for ddoc in ddocs:
results = self.create_ddoc(rest, 'default', ddoc)
try:
cluster = Cluster()
cluster.delete_view(self.servers[0], ddocs[1].name, ddocs[1].views[0])
finally:
cluster.shutdown()
results_new = rest.query_view(ddocs[0].name, ddocs[0].views[0].name, 'default',
{"stale" : "ok", "full_set" : "true"})
self.assertEquals(results.get(u'rows', []), results_new.get(u'rows', []),
"Results returned previosly %s don't match with current %s" % (
results.get(u'rows', []), results_new.get(u'rows', [])))