4 Commits

Author SHA1 Message Date
elajkat
23fb666f92 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
2021-07-27 14:56:36 +09:00
Reedip Banerjee
18ce7d9f2e Fix arg order of assertEqual and use assertTrue
assertEqual expects that the arguments provided to it should be
(expected, observed).If a particluar order is kept as a convention,
then it helps to provide a cleaner message to the developer if Unit Tests
fail. There are several Unit Test files where the arguments for assertEqual
have been swapped. This commit fixes the issue in python-neutronclient.

Additionally instead of using assertEqual(True,xxx), assertTrue(xxx) should
be used. The same has been fixed in this patch.

Partial-Bug: #1259292
Related-Bug: #1259292

Change-Id: I83ec45af75f61f8005a60efc8176db0df5cfbe9a
2015-10-07 13:40:57 +05:30
Akihiro Motoki
ed46ba9a45 Remove author tag
We have a hacking rule H105 (Don't use author tags) now
and the same policy has been applied to other neutron repos.

Change-Id: I1a1a35bbfaad6bbe229b9b12cf6cfb405b6ed516
2015-03-23 15:44:08 +09:00
Isaku Yamahata
4164de2bdb setup logger name of NeutronCommand automatically
It is a common pattern to add
class XXXCommand(NeutronCommand):
    log = logging.getLogger(__name__ + '.<command name>').
So introduce a metaclass to do that automatically in order to simplify
the code a bit.

Closes-Bug: #1258028
Change-Id: I7908e3e2c0f3f04d9e57360f6ba22e153d0d35bd
2014-07-30 23:15:28 +09:00