55class TestMetricFunctionsBase (unittest .TestCase ):
66
77 def setUp (self ):
8- self .test_tenant = str (uuid .uuid4 ())
8+ self .maxDiff = None
9+ self .test_tenant = unicode (str (uuid .uuid4 ()))
910 self .client = HawkularMetricsClient (tenant_id = self .test_tenant , port = 8080 )
1011
1112class TenantTestCase (TestMetricFunctionsBase ):
@@ -15,7 +16,7 @@ class TenantTestCase(TestMetricFunctionsBase):
1516 """
1617
1718 def test_tenant_creation (self ):
18- tenant = str (uuid .uuid4 ())
19+ tenant = unicode ( str (uuid .uuid4 () ))
1920 self .client .create_tenant (tenant )
2021 tenants = self .client .query_tenants ()
2122
@@ -61,11 +62,11 @@ def test_gauge_creation(self):
6162
6263 # This is what the returned dict should look like
6364 expect = [
64- {' id' : 'test.create.gauge.1' ,
65- 'tenantId' : self .test_tenant },
66- {'dataRetention' : 90 , ' id' : 'test.create.gauge.2' , 'tenantId' : self .test_tenant },
67- {'tags' : {'units' : 'bytes' , 'env' : 'qa' },
68- 'id' : 'test.create.gauge.3' , 'dataRetention' : 90 , 'tenantId' : self .test_tenant }]
65+ { u'dataRetention' : 7 , u'type' : u'gauge' , u' id' : u 'test.create.gauge.1' ,
66+ u 'tenantId' : self .test_tenant },
67+ {u 'dataRetention' : 90 , u'type' : u'gauge' , u' id' : u 'test.create.gauge.2' , u 'tenantId' : self .test_tenant },
68+ {u 'tags' : {u 'units' : u 'bytes' , u 'env' : u 'qa' },
69+ u 'id' : u 'test.create.gauge.3' , u 'dataRetention' : 90 , u'type' : u'gauge' , u 'tenantId' : self .test_tenant }]
6970
7071 self .assertEqual (m , expect ) # Did it?
7172
@@ -167,8 +168,8 @@ def test_add_availability_multi_datapoint(self):
167168 data = self .client .query_single_availability ('test.avail.multi' )
168169
169170 self .assertEqual (len (data ), 2 )
170- self .assertEqual (data [0 ]['value' ], 'up ' )
171- self .assertEqual (data [1 ]['value' ], 'down ' )
171+ self .assertEqual (data [0 ]['value' ], 'down ' )
172+ self .assertEqual (data [1 ]['value' ], 'up ' )
172173
173174 def test_add_mixed_metrics_and_datapoints (self ):
174175 metric1 = create_datapoint (float (1.45 ))
0 commit comments