Change counter to sample in network tests
This changes counter to sample vocable in network tests Parts of the blueprint remove-counter Change-Id: Ic57ee893440f6c973a3b9f1ca6c1334843168ae1
This commit is contained in:
parent
efc491b94d
commit
149eded143
@ -81,7 +81,7 @@ class TestFloatingIPPollster(base.TestCase):
|
||||
self.assertEqual(samples[2].resource_metadata["address"], "1.1.1.3")
|
||||
self.assertEqual(samples[2].resource_metadata["pool"], "public")
|
||||
|
||||
def test_get_counter_names(self):
|
||||
def test_get_meter_names(self):
|
||||
samples = list(self.pollster.get_samples(self.manager, {}))
|
||||
self.assertEqual(set([s.name for s in samples]),
|
||||
set(['ip.floating']))
|
||||
|
@ -206,43 +206,43 @@ NOTIFICATION_FLOATINGIP_EXISTS = {
|
||||
class TestNotifications(base.TestCase):
|
||||
def test_network_create(self):
|
||||
v = notifications.Network()
|
||||
counters = list(v.process_notification(NOTIFICATION_NETWORK_CREATE))
|
||||
self.assertEqual(len(counters), 2)
|
||||
self.assertEqual(counters[1].name, "network.create")
|
||||
samples = list(v.process_notification(NOTIFICATION_NETWORK_CREATE))
|
||||
self.assertEqual(len(samples), 2)
|
||||
self.assertEqual(samples[1].name, "network.create")
|
||||
|
||||
def test_subnet_create(self):
|
||||
v = notifications.Subnet()
|
||||
counters = list(v.process_notification(NOTIFICATION_SUBNET_CREATE))
|
||||
self.assertEqual(len(counters), 2)
|
||||
self.assertEqual(counters[1].name, "subnet.create")
|
||||
samples = list(v.process_notification(NOTIFICATION_SUBNET_CREATE))
|
||||
self.assertEqual(len(samples), 2)
|
||||
self.assertEqual(samples[1].name, "subnet.create")
|
||||
|
||||
def test_port_create(self):
|
||||
v = notifications.Port()
|
||||
counters = list(v.process_notification(NOTIFICATION_PORT_CREATE))
|
||||
self.assertEqual(len(counters), 2)
|
||||
self.assertEqual(counters[1].name, "port.create")
|
||||
samples = list(v.process_notification(NOTIFICATION_PORT_CREATE))
|
||||
self.assertEqual(len(samples), 2)
|
||||
self.assertEqual(samples[1].name, "port.create")
|
||||
|
||||
def test_port_update(self):
|
||||
v = notifications.Port()
|
||||
counters = list(v.process_notification(NOTIFICATION_PORT_UPDATE))
|
||||
self.assertEqual(len(counters), 2)
|
||||
self.assertEqual(counters[1].name, "port.update")
|
||||
samples = list(v.process_notification(NOTIFICATION_PORT_UPDATE))
|
||||
self.assertEqual(len(samples), 2)
|
||||
self.assertEqual(samples[1].name, "port.update")
|
||||
|
||||
def test_network_exists(self):
|
||||
v = notifications.Network()
|
||||
counters = v.process_notification(NOTIFICATION_NETWORK_EXISTS)
|
||||
self.assertEqual(len(list(counters)), 1)
|
||||
samples = v.process_notification(NOTIFICATION_NETWORK_EXISTS)
|
||||
self.assertEqual(len(list(samples)), 1)
|
||||
|
||||
def test_router_exists(self):
|
||||
v = notifications.Router()
|
||||
counters = v.process_notification(NOTIFICATION_ROUTER_EXISTS)
|
||||
self.assertEqual(len(list(counters)), 1)
|
||||
samples = v.process_notification(NOTIFICATION_ROUTER_EXISTS)
|
||||
self.assertEqual(len(list(samples)), 1)
|
||||
|
||||
def test_floatingip_exists(self):
|
||||
v = notifications.FloatingIP()
|
||||
counters = list(v.process_notification(NOTIFICATION_FLOATINGIP_EXISTS))
|
||||
self.assertEqual(len(counters), 1)
|
||||
self.assertEqual(counters[0].name, "ip.floating")
|
||||
samples = list(v.process_notification(NOTIFICATION_FLOATINGIP_EXISTS))
|
||||
self.assertEqual(len(samples), 1)
|
||||
self.assertEqual(samples[0].name, "ip.floating")
|
||||
|
||||
|
||||
class TestEventTypes(base.TestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user