本文整理汇总了Python中ceilometer.api.controllers.v2.Query类的典型用法代码示例。如果您正苦于以下问题:Python Query类的具体用法?Python Query怎么用?Python Query使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Query类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_value_as_type_with_boolean
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)