本文整理汇总了Python中kinto.core.resource.ViewSet.get_service_name方法的典型用法代码示例。如果您正苦于以下问题:Python ViewSet.get_service_name方法的具体用法?Python ViewSet.get_service_name怎么用?Python ViewSet.get_service_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kinto.core.resource.ViewSet
的用法示例。
在下文中一共展示了ViewSet.get_service_name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_service_name_returns_resource_att_if_not_callable
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import get_service_name [as 别名]
def test_get_service_name_returns_resource_att_if_not_callable(self):
viewset = ViewSet()
resource = mock.MagicMock()
resource.name = 'fakename'
self.assertEquals(
viewset.get_service_name('record', resource),
'fakename-record')
示例2: test_get_service_name_doesnt_use_callable_as_a_name
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import get_service_name [as 别名]
def test_get_service_name_doesnt_use_callable_as_a_name(self):
viewset = ViewSet()
resource = mock.MagicMock()
resource.name = lambda x: 'should not be called'
resource.__name__ = "FakeName"
self.assertEquals(
viewset.get_service_name('record', resource),
'fakename-record')
示例3: test_get_service_name_returns_resource_att_if_not_callable
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import get_service_name [as 别名]
def test_get_service_name_returns_resource_att_if_not_callable(self):
viewset = ViewSet()
resource = mock.MagicMock()
resource.name = "fakename"
self.assertEqual(viewset.get_service_name("record", resource), "fakename-record")
示例4: test_get_service_name_returns_the_viewset_name_if_defined
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import get_service_name [as 别名]
def test_get_service_name_returns_the_viewset_name_if_defined(self):
viewset = ViewSet(name='fakename')
self.assertEquals(
viewset.get_service_name('record', mock.MagicMock),
'fakename-record')
示例5: test_get_service_name_returns_the_viewset_name_if_defined
# 需要导入模块: from kinto.core.resource import ViewSet [as 别名]
# 或者: from kinto.core.resource.ViewSet import get_service_name [as 别名]
def test_get_service_name_returns_the_viewset_name_if_defined(self):
viewset = ViewSet(name="fakename")
self.assertEqual(viewset.get_service_name("record", mock.MagicMock), "fakename-record")