From 149eded143162ddf3d693b0e365634f4c4b0b3ac Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Tue, 20 Aug 2013 18:24:27 +0200 Subject: [PATCH] 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 --- tests/network/test_floatingip.py | 2 +- tests/network/test_notifications.py | 38 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/network/test_floatingip.py b/tests/network/test_floatingip.py index c37c67038..ba1b8a772 100644 --- a/tests/network/test_floatingip.py +++ b/tests/network/test_floatingip.py @@ -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'])) diff --git a/tests/network/test_notifications.py b/tests/network/test_notifications.py index 3302d1e52..c6cda13f4 100644 --- a/tests/network/test_notifications.py +++ b/tests/network/test_notifications.py @@ -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):