Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sileht committed Jan 18, 2017
1 parent 4c0d119 commit a2d027b
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions gnocchi_nagios/tests/test_gnocchi_nagios.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ def test_main(self):
'attributes': {'host': {'max_length': 255,
'min_length': 0,
'required': True,
'type': 'string'},
'service': {'max_length': 255,
'min_length': 0,
'required': True,
'type': 'string'}},
'type': 'string'}},
'name': 'nagios-service',
'state': 'active'}
self.assertEqual(expected_rt, rt)
Expand Down Expand Up @@ -162,16 +158,13 @@ def test_processor(self):

c = gnocchi_client.get_gnocchiclient(self.conf)
resources = c.resource.list('nagios-service')
self.assertEqual(2, len(resources))
self.assertEqual(['arn::Uptime', 'arn::fs_/'],
self.assertEqual(1, len(resources))
self.assertEqual(['arn'],
sorted([r['original_resource_id']
for r in resources]))
self.assertEqual(['arn', 'arn'],
sorted([r['host']
for r in resources]))
self.assertEqual(['Uptime', 'fs_/'],
sorted([r['service']
for r in resources]))

metrics = c.metric.list()
self.assertEqual(6, len(metrics))
Expand All @@ -186,8 +179,8 @@ def test_processor(self):
# self.assertEqual(expected_measures, measures)

measures = c.metric.get_measures(
"trend",
resource_id=perfdata_processor.encode_resource_id("arn::fs_/"),
"fs_%::trend",
resource_id="arn",
refresh=True)
expected_measures = [
['2016-11-21T00:00:00+00:00', 86400.0, -1.658471],
Expand All @@ -196,7 +189,7 @@ def test_processor(self):
]
self.assertEqual(expected_measures, measures)

measures = c.metric.get_measures("uptime", resource_id="arn::Uptime",
measures = c.metric.get_measures("Uptime::uptime", resource_id="arn",
refresh=True)
expected_measures = [
[u'2016-11-21T00:00:00+00:00', 86400.0, 9175101.06],
Expand Down

0 comments on commit a2d027b

Please sign in to comment.