本文整理汇总了Python中ceilometer.api.controllers.v2.Query._get_value_as_type方法的典型用法代码示例。如果您正苦于以下问题:Python Query._get_value_as_type方法的具体用法?Python Query._get_value_as_type怎么用?Python Query._get_value_as_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ceilometer.api.controllers.v2.Query
的用法示例。
在下文中一共展示了Query._get_value_as_type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_value_as_type_with_boolean
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_boolean(self):
query = Query(field='metadata.is_public',
op='eq',
value='True',
type='boolean')
expected = True
self.assertEqual(query._get_value_as_type(), expected)
示例2: test_get_value_as_type_with_string
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_string(self):
query = Query(field='metadata.name',
op='eq',
value='linux',
type='string')
expected = 'linux'
self.assertEqual(query._get_value_as_type(), expected)
示例3: test_get_value_as_type_with_integer
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_integer(self):
query = Query(field='metadata.size',
op='eq',
value='123',
type='integer')
expected = 123
self.assertEqual(query._get_value_as_type(), expected)
示例4: test_get_value_as_type_with_float
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_float(self):
query = Query(field='metadata.size',
op='eq',
value='123.456',
type='float')
expected = 123.456
self.assertEqual(query._get_value_as_type(), expected)
示例5: test_get_value_as_type_integer_expression_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_integer_expression_without_type(self):
# bug 1221736
query = Query(field='should_be_a_string',
op='eq',
value='123-1')
expected = '123-1'
self.assertEqual(query._get_value_as_type(), expected)
示例6: test_get_value_as_type_boolean_expression_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_boolean_expression_without_type(self):
# bug 1221736
query = Query(field='should_be_a_string',
op='eq',
value='True or False')
expected = 'True or False'
self.assertEqual(query._get_value_as_type(), expected)
示例7: test_get_value_as_type_with_syntax_error_colons
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_syntax_error_colons(self):
# bug 1221736
value = 'Ref::StackId'
query = Query(field='field_name',
op='eq',
value=value)
expected = value
self.assertEqual(query._get_value_as_type(), expected)
示例8: test_get_value_as_type_with_syntax_error
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_syntax_error(self):
# bug 1221736
value = 'WWW-Layer-4a80714f-0232-4580-aa5e-81494d1a4147-uolhh25p5xxm'
query = Query(field='group_id',
op='eq',
value=value)
expected = value
self.assertEqual(query._get_value_as_type(), expected)
示例9: test_get_value_as_type_boolean_expression_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_boolean_expression_without_type(self):
# bug 1221736
query = Query(field="should_be_a_string", op="eq", value="True or False")
expected = "True or False"
self.assertEqual(query._get_value_as_type(), expected)
示例10: test_get_value_as_type_with_syntax_error_colons
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_syntax_error_colons(self):
# bug 1221736
value = "Ref::StackId"
query = Query(field="field_name", op="eq", value=value)
expected = value
self.assertEqual(query._get_value_as_type(), expected)
示例11: test_get_value_as_type_integer_expression_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_integer_expression_without_type(self):
# bug 1221736
query = Query(field="should_be_a_string", op="eq", value="123-1")
expected = "123-1"
self.assertEqual(query._get_value_as_type(), expected)
示例12: test_get_value_as_type_with_string_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_string_without_type(self):
query = Query(field="metadata.name", op="eq", value="linux")
expected = "linux"
self.assertEqual(query._get_value_as_type(), expected)
示例13: test_get_value_as_type_with_boolean_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_boolean_without_type(self):
query = Query(field="metadata.is_public", op="eq", value="True")
expected = True
self.assertEqual(query._get_value_as_type(), expected)
示例14: test_get_value_as_type_with_float_without_type
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_float_without_type(self):
query = Query(field="metadata.size", op="eq", value="123.456")
expected = 123.456
self.assertEqual(query._get_value_as_type(), expected)
示例15: test_get_value_as_type_with_integer
# 需要导入模块: from ceilometer.api.controllers.v2 import Query [as 别名]
# 或者: from ceilometer.api.controllers.v2.Query import _get_value_as_type [as 别名]
def test_get_value_as_type_with_integer(self):
query = Query(field="metadata.size", op="eq", value="123", type="integer")
expected = 123
self.assertEqual(query._get_value_as_type(), expected)