13 Commits

Author SHA1 Message Date
Stephen Finucane
f68000d772 tests: Remove aliasing from extensions test
This isn't necessary and makes migration of the compute client a little
more difficult.

Change-Id: Ib07e60171c43838935ea30f4916bf68d54cdc944
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-18 13:39:39 +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
b25742499a tests: Use consistent shortcut to fake network client
This removes the need for a number of base test case subclasses. We use
'network_client' rather than 'network' for consistency with other
services.

Change-Id: I61f7c43341acf19ae16d06db34e18970297fbb93
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
b87b57551b Migrate 'extension list' to SDK
Migrate the block storage aspects of this command to SDK. This means the
'extension list' command, like the 'availability zone list' command
previously, is now using SDK entirely.

While we're here, we also make some fixes to the unit tests for the
network and compute aspects of the command. While we migrated the
network and compute extension commands from neutronclient and novaclient
respectively some time back, we never fully updated the tests. Do this
now.

Change-Id: I631a6a09dfd9d614b1dd7b322dcee8490a52cc43
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/885132
2023-08-28 13:51:34 +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
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
Matt Riedemann
4b393681d9 Use SDK to get compute API extensions
python-novaclient 16.0.0 removed the deprecated
list_extensions module [1] so this changes the
extensions command to use openstacksdk to get the
compute API extensions.

The functional test ExtensionTests.test_extension_list_compute
ensures this works.

[1] https://review.opendev.org/686516/

Change-Id: I9894bc395c0474aaa6494ac4534862efe4ea7984
Story: #2006769
Task: #37284
2019-10-31 16:48:29 +00:00
Ankur Gupta
acc2d106ab Refactor Extension show and list command
1.keep the column display order consist in extension list with
  and without "--long" option.
2.rework for network extentsion list, openstacksdk return object,
  so the logic should be same with other service.
3.add some unit test cases, like: extension list --network --long,
  extension list --network --compute, to cover regular use cases.
4.raise exact exception when network extension don't exist, avoid
  internal TypeError in "extension show" commands.

Change-Id: I2e23ced80d8da8aa1106b22472db850367b351ce
Closes-Bug: #1689233
2017-05-18 11:33:45 +08:00
Sindhu Devale
832b2591cf OSC Extension Show
Implement Neutron feature of Extension Show into
OpenStack Client.

Change-Id: Ifecb794838cb3bf8c2466d178345349db3cd4003
Implements: blueprint extension-show
2017-03-22 16:39:19 +00: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