14 Commits

Author SHA1 Message Date
Stephen Finucane
912a21a8fd tests: Add compute v2 FakeClientMixin
This ensures we are speccing the compute proxy API.

Change-Id: I7adbf2666d71f222fbd9c1479216f72cb9893348
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
187a454ec0 tests: Use consistent shortcut to fake compute client
This removes the need for a number of base test case subclasses. We use
'compute_client' rather than 'client' to avoid conflicts with clients
for other services.

Change-Id: I430214cd79eca481bd8d8c53bf97eaede6766eb4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
98fb1678bc tests: Add volume v1, v2, v3 FakeClientMixin
This ensures we are speccing the image proxy API, as we did previously
for the network tests in Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758.

Change-Id: I132ccd1170cc903f6edc505926b071170aeaa08c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
4cabf6f7a2 tests: Use consistent shortcut to fake volume client
This removes the need for a number of base test case subclasses. We use
'volume_client' rather than 'client' to avoid conflicts with clients for
other services.

Change-Id: I28d78f32142bb3a3fde0ba1780c504adc31cc77c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:30 +01:00
Stephen Finucane
02cc064258 tests: Use central SDK client fake
Avoid double mocking.

Change-Id: Ic8fadd41f3687eabd3a149681effae6883edb12e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:12:19 +01:00
Stephen Finucane
a39bde5c3a tests: Add network v2 FakeClientMixin
This ensures we are speccing the network proxy API. Future changes will
do the same for the image proxy API and eventually the compute proxy API
(once everything has been converted).

Change-Id: Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
44cf963d8e Migrate 'availability zone list' to SDK
This is a bit of an odd one. Because this is a "common" command, there
are three clients in play here: a compute client, a block storage
client, and a networking client. The networking aspects of this command
are already using SDK though the tests were mistakenly using a fake
version of the legacy neutron client (albeit one with the correct SDK
properties). We were still using legacy clients for the other two.
Correct the networking tests and migrate the compute and block storage
aspects of the command.

Change-Id: I292e1a712bca97e1270e8a97606e02a8a44c2954
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:51:33 +01:00
Stephen Finucane
19be070204 tests: Remove unnecessary nesting of compute resources
Change-Id: I27326b8f2e0d84d3ef2c2fbdcb5c96a5ac1d79e4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-16 16:21:44 +01:00
Stephen Finucane
7d80f9e962 Blacken openstack.common
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: Ifcb3c798666d74d596b8ecb3d6d507f782de7ba5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
1aaaa6f1d1 tests: Remove unnecessary nesting of volume resources
Change-Id: I210ce7534d161e89115e5cb96e42ab7f27170aa1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 11:42:07 +00:00
Nurmatov Mamatisa
23ad68264b Refactor network fakes to sdk properties PART 1
Included resources:
address_group
address_scope
auto_allocated_topology
availability_zone

Change-Id: I943f988588efbe68dd3ab17a18441b25ac8c8d4d
2022-03-15 11:28:44 +03:00
Sean McGinnis
69db9fe73c
Raise flake8-import-order version to latest
We had this library capped at a release that is a few years old. Now
that we have dropped py2 testing, we can pick up the latest version.

This uncovered a few things to clean up. Mostly the fact that mock is
now a part of the StdLib unittest since Python 3.3.

Change-Id: I27484dd4c25378413ff16e97a35a1a46062357bc
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-01-10 14:21:47 -06:00
lihaijing
d15bbada73 Replace six.iteritems() with .items()
1. As mentioned in [1], we should avoid using six.iteritems to achieve
   iterators. We can use dict.items instead, as it will return iterators
   in PY3 as well. And dict.items/keys will more readable.

2. In py2, the performance about list should be negligible,
   see the link [2].

[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85
Implements: blueprint replace-iteritems-with-items
2020-01-09 18:41:29 +09:00
Steve Martinelli
39839def2e move unit tests to new "unit" test module
this will better isolate the unit tests from the functional tests.
unfortunately, the "integration" tests had to be lumped into the
"unit" tests since we need the separation in testr.conf

Change-Id: Ifd12198c1f90e4e3c951c73bfa1884ab300d8ded
2016-09-08 15:19:50 -07:00