Using assertIsNone() instead of assertIs(None, ..)
Following OpenStack Style Guidelines[1]: http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises [H203] Unit test assertions tend to give better messages for more specific assertions. As a result, assertIsNone(...) is preferred over assertEqual(None, ...) and assertIs(..,None). Change-Id: I72327e4c740ef11ee9cba4cda9642e4a270d1b52
This commit is contained in:
parent
59e25b504d
commit
e3b3947af8
|
@ -157,7 +157,7 @@ class TestuNeutronModels(base.RugTestBase):
|
||||||
}
|
}
|
||||||
s = neutron.Subnet.from_dict(d)
|
s = neutron.Subnet.from_dict(d)
|
||||||
self.assertEqual(netaddr.IPNetwork('fe80::/64'), s.cidr)
|
self.assertEqual(netaddr.IPNetwork('fe80::/64'), s.cidr)
|
||||||
self.assertIs(None, s.gateway_ip)
|
self.assertIsNone(s.gateway_ip)
|
||||||
|
|
||||||
def test_subnet_gateway_not_ip(self):
|
def test_subnet_gateway_not_ip(self):
|
||||||
d = {
|
d = {
|
||||||
|
@ -175,7 +175,7 @@ class TestuNeutronModels(base.RugTestBase):
|
||||||
}
|
}
|
||||||
s = neutron.Subnet.from_dict(d)
|
s = neutron.Subnet.from_dict(d)
|
||||||
self.assertEqual(netaddr.IPNetwork('fe80::/64'), s.cidr)
|
self.assertEqual(netaddr.IPNetwork('fe80::/64'), s.cidr)
|
||||||
self.assertIs(None, s.gateway_ip)
|
self.assertIsNone(s.gateway_ip)
|
||||||
|
|
||||||
def test_subnet_cidr_none(self):
|
def test_subnet_cidr_none(self):
|
||||||
d = {
|
d = {
|
||||||
|
|
|
@ -233,7 +233,7 @@ class TestGetCRUD(base.RugTestBase):
|
||||||
|
|
||||||
def test_notification_astara(self):
|
def test_notification_astara(self):
|
||||||
e = self._get_event_notification('astara.bandwidth.used')
|
e = self._get_event_notification('astara.bandwidth.used')
|
||||||
self.assertIs(None, e)
|
self.assertIsNone(e)
|
||||||
|
|
||||||
def test_notification_cmd_poll(self):
|
def test_notification_cmd_poll(self):
|
||||||
event_type = 'astara.command'
|
event_type = 'astara.command'
|
||||||
|
|
Loading…
Reference in New Issue