本文整理汇总了Python中kinto.core.resource.ViewSet.is_endpoint_enabled方法的典型用法代码示例。如果您正苦于以下问题:Python ViewSet.is_endpoint_enabled方法的具体用法?Python ViewSet.is_endpoint_enabled怎么用?Python ViewSet.is_endpoint_enabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kinto.core.resource.ViewSet
的用法示例。
在下文中一共展示了ViewSet.is_endpoint_enabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_endpoint_enabled_returns_true_for_head_if_readonly
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import is_endpoint_enabled [as 别名]
def test_is_endpoint_enabled_returns_true_for_head_if_readonly(self):
viewset = ViewSet()
config = {
'readonly': True
}
is_enabled = viewset.is_endpoint_enabled('record', 'fake', 'head',
config)
self.assertTrue(is_enabled)
示例2: test_is_endpoint_enabled_returns_false_for_delete_if_readonly
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import is_endpoint_enabled [as 别名]
def test_is_endpoint_enabled_returns_false_for_delete_if_readonly(self):
viewset = ViewSet()
config = {
'readonly': True
}
is_enabled = viewset.is_endpoint_enabled('record', 'fake', 'delete',
config)
self.assertFalse(is_enabled)
示例3: test_is_endpoint_enabled_returns_true_if_enabled
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import is_endpoint_enabled [as 别名]
def test_is_endpoint_enabled_returns_true_if_enabled(self):
viewset = ViewSet()
config = {
'record_fake_get_enabled': True
}
is_enabled = viewset.is_endpoint_enabled('record', 'fake', 'get',
config)
self.assertTrue(is_enabled)
示例4: test_is_endpoint_enabled_returns_true_for_head_if_readonly
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import is_endpoint_enabled [as 别名]
def test_is_endpoint_enabled_returns_true_for_head_if_readonly(self):
viewset = ViewSet()
config = {"readonly": True}
is_enabled = viewset.is_endpoint_enabled("record", "fake", "head", config)
self.assertTrue(is_enabled)
示例5: test_is_endpoint_enabled_returns_false_for_delete_if_readonly
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import is_endpoint_enabled [as 别名]
def test_is_endpoint_enabled_returns_false_for_delete_if_readonly(self):
viewset = ViewSet()
config = {"readonly": True}
is_enabled = viewset.is_endpoint_enabled("record", "fake", "delete", config)
self.assertFalse(is_enabled)
示例6: test_is_endpoint_enabled_returns_true_if_enabled
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import is_endpoint_enabled [as 别名]
def test_is_endpoint_enabled_returns_true_if_enabled(self):
viewset = ViewSet()
config = {"record_fake_get_enabled": True}
is_enabled = viewset.is_endpoint_enabled("record", "fake", "get", config)
self.assertTrue(is_enabled)