@@ -22,14 +22,14 @@ def setUp(self):
22
22
"region" : "us-west" },
23
23
"columns" : ["time" , "value" ],
24
24
"values" : [
25
- ["2015-01-29T21:51:28.968422294Z" , 0.64 ]
25
+ ["2015-01-29T21:51:28.968422294Z" , 0.65 ]
26
26
]},
27
27
{"name" : "other_serie" ,
28
28
"tags" : {"host" : "server01" ,
29
29
"region" : "us-west" },
30
30
"columns" : ["time" , "value" ],
31
31
"values" : [
32
- ["2015-01-29T21:51:28.968422294Z" , 0.64 ]
32
+ ["2015-01-29T21:51:28.968422294Z" , 0.66 ]
33
33
]}]}
34
34
]
35
35
}
@@ -40,11 +40,20 @@ def test_filter_by_name(self):
40
40
list (self .rs ['cpu_load_short' ]),
41
41
[
42
42
{'value' : 0.64 , 'time' : '2015-01-29T21:51:28.968422294Z' },
43
- {'value' : 0.64 , 'time' : '2015-01-29T21:51:28.968422294Z' }
43
+ {'value' : 0.65 , 'time' : '2015-01-29T21:51:28.968422294Z' }
44
44
]
45
45
)
46
46
47
47
def test_filter_by_tags (self ):
48
+ self .assertEqual (
49
+ list (self .rs [{"host" : "server01" }]),
50
+ [
51
+ {'time' : '2015-01-29T21:51:28.968422294Z' , 'value' : 0.64 },
52
+ {'time' : '2015-01-29T21:51:28.968422294Z' , 'value' : 0.66 }
53
+ ]
54
+ )
55
+
56
+ def test_filter_by_name_and_tags (self ):
48
57
self .assertEqual (
49
58
list (self .rs [('cpu_load_short' , {"host" : "server01" })]),
50
59
[{'time' : '2015-01-29T21:51:28.968422294Z' , 'value' : 0.64 }]
@@ -54,7 +63,7 @@ def test_filter_by_tags(self):
54
63
list (self .rs [('cpu_load_short' , {"region" : "us-west" })]),
55
64
[
56
65
{'value' : 0.64 , 'time' : '2015-01-29T21:51:28.968422294Z' },
57
- {'value' : 0.64 , 'time' : '2015-01-29T21:51:28.968422294Z' }
66
+ {'value' : 0.65 , 'time' : '2015-01-29T21:51:28.968422294Z' }
58
67
]
59
68
)
60
69
@@ -89,12 +98,12 @@ def test_items(self):
89
98
(
90
99
('cpu_load_short' ,
91
100
{'host' : 'server02' , 'region' : 'us-west' }),
92
- [{'value' : 0.64 , 'time' : '2015-01-29T21:51:28.968422294Z' }]
101
+ [{'value' : 0.65 , 'time' : '2015-01-29T21:51:28.968422294Z' }]
93
102
),
94
103
(
95
104
('other_serie' ,
96
105
{'host' : 'server01' , 'region' : 'us-west' }),
97
- [{'value' : 0.64 , 'time' : '2015-01-29T21:51:28.968422294Z' }]
106
+ [{'value' : 0.66 , 'time' : '2015-01-29T21:51:28.968422294Z' }]
98
107
)
99
108
]
100
109
)
0 commit comments