compute: fix notifications test
This test isn't run anymore because it yields things, and that seems to have no sense. Let's fix it. Change-Id: I97a4a956895f973b5ece30848a845db3fa6d67c0 Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
3340461656
commit
00898e1d2f
@ -22,6 +22,7 @@ notification events.
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from ceilometer.compute import notifications
|
from ceilometer.compute import notifications
|
||||||
|
from ceilometer import counter
|
||||||
|
|
||||||
|
|
||||||
INSTANCE_CREATE_END = {
|
INSTANCE_CREATE_END = {
|
||||||
@ -287,26 +288,24 @@ INSTANCE_RESIZE_REVERT_END = {
|
|||||||
|
|
||||||
class TestNotifications(unittest.TestCase):
|
class TestNotifications(unittest.TestCase):
|
||||||
def test_process_notification(self):
|
def test_process_notification(self):
|
||||||
info = notifications.Instance.process_notification(
|
info = notifications.Instance().process_notification(
|
||||||
INSTANCE_CREATE_END
|
INSTANCE_CREATE_END
|
||||||
)[0]
|
)[0]
|
||||||
|
|
||||||
for name, actual, expected in [
|
for name, actual, expected in [
|
||||||
('counter_name', info.name, 'instance'),
|
('counter_name', info.name, 'instance'),
|
||||||
('counter_type', info.type, counter.TYPE_CUMULATIVE),
|
('counter_type', info.type, counter.TYPE_GAUGE),
|
||||||
('counter_volume', info.volume, 1),
|
('counter_volume', info.volume, 1),
|
||||||
('timestamp', info.timestamp,
|
('timestamp', info.timestamp,
|
||||||
INSTANCE_CREATE_END['timestamp']),
|
INSTANCE_CREATE_END['timestamp']),
|
||||||
('resource_id', info.resource_id,
|
('resource_id', info.resource_id,
|
||||||
INSTANCE_CREATE_END['payload']['instance_id']),
|
INSTANCE_CREATE_END['payload']['instance_id']),
|
||||||
('display_name', info.resource_metadata['display_name'],
|
('instance_type', info.resource_metadata['instance_type'],
|
||||||
INSTANCE_CREATE_END['payload']['display_name']),
|
INSTANCE_CREATE_END['payload']['instance_type_id']),
|
||||||
('instance_type', info.resource_metadata['instance_type'],
|
('host', info.resource_metadata['host'],
|
||||||
INSTANCE_CREATE_END['payload']['instance_type_id']),
|
INSTANCE_CREATE_END['publisher_id']),
|
||||||
('host', info.resource_metadata['host'],
|
|
||||||
INSTANCE_CREATE_END['publisher_id']),
|
|
||||||
]:
|
]:
|
||||||
yield compare, name, actual, expected
|
self.assertEqual(actual, expected, name)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _find_counter(counters, name):
|
def _find_counter(counters, name):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user