summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelajkat <lajos.katona@est.tech>2021-07-26 14:54:15 +0200
committerAkihiro Motoki <amotoki@gmail.com>2021-07-27 14:56:36 +0900
commit23fb666f923e9fa117ce5744e9abe00d3874d3fc (patch)
tree16c73b2354ddad98509f6b2eeea962e7a2c77eb5
parentadf21f028827b8a4e32057334db4cd464c24c4d0 (diff)
downloadpython-neutronclient-23fb666f923e9fa117ce5744e9abe00d3874d3fc.tar.gz
tests: change safe_hasattr to hasattr
testtools 2.5.0 removed the helper (see [0]) safe_hasattr, and assumes that the hasattr implementation in python reliable enough now. test_neutron_dhcp_agent_list_hosting_net is skipped temporarily as there is no DHCP agent with ML2/OVN. It will be re-enabled [1]. [0] https://github.com/testing-cabal/testtools/blob/2.5.0/NEWS#L31 [1] https://review.opendev.org/c/openstack/python-neutronclient/+/801997 Change-Id: I4fe6fabc4f745e2c9a366e30dbea7e7200151f12
-rw-r--r--neutronclient/tests/functional/core/test_readonly_neutron.py2
-rw-r--r--neutronclient/tests/unit/test_command_meta.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/neutronclient/tests/functional/core/test_readonly_neutron.py b/neutronclient/tests/functional/core/test_readonly_neutron.py
index 4fe9897..41ee524 100644
--- a/neutronclient/tests/functional/core/test_readonly_neutron.py
+++ b/neutronclient/tests/functional/core/test_readonly_neutron.py
@@ -13,6 +13,7 @@
import re
from tempest.lib import exceptions
+import testtools
from neutronclient.tests.functional import base
@@ -51,6 +52,7 @@ class SimpleReadOnlyNeutronClientTest(base.ClientTestBase):
ext = self.parser.listing(self.neutron('ext-list'))
self.assertTableStruct(ext, ['alias', 'name'])
+ @testtools.skip('Skipped until ML2/OVS is enabled')
def test_neutron_dhcp_agent_list_hosting_net(self):
self.neutron('dhcp-agent-list-hosting-net',
params='private')
diff --git a/neutronclient/tests/unit/test_command_meta.py b/neutronclient/tests/unit/test_command_meta.py
index 184f366..dedc3dd 100644
--- a/neutronclient/tests/unit/test_command_meta.py
+++ b/neutronclient/tests/unit/test_command_meta.py
@@ -20,7 +20,6 @@
import logging
import testtools
-from testtools import helpers
from neutronclient.neutron import v2_0 as neutronV20
@@ -30,7 +29,7 @@ class TestCommandMeta(testtools.TestCase):
class FakeCommand(neutronV20.NeutronCommand):
pass
- self.assertTrue(helpers.safe_hasattr(FakeCommand, 'log'))
+ self.assertTrue(hasattr(FakeCommand, 'log'))
self.assertIsInstance(FakeCommand.log, logging.getLoggerClass())
self.assertEqual(__name__ + ".FakeCommand", FakeCommand.log.name)
@@ -38,5 +37,5 @@ class TestCommandMeta(testtools.TestCase):
class FakeCommand(neutronV20.NeutronCommand):
log = None
- self.assertTrue(helpers.safe_hasattr(FakeCommand, 'log'))
+ self.assertTrue(hasattr(FakeCommand, 'log'))
self.assertIsNone(FakeCommand.log)