We were seeing the following test failures on Python 3.12:
openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_all
openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_no_options
Both failures were caused by missing attributes of 'sys', e.g.
AttributeError: module 'sys' has no attribute 'builtin_module_names'
Fix this by exposing the real 'sys' module as part of our mock of
'sys.modules'.
Change-Id: I17391a46f08896f49dccaf75ad685dab1375a03d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This change is entirely automated save for the update of some mocks from
'io.open' to '__builtins__.open').
We are keeping this change separate from addition of the actual hook so
that we can ignore the commit later.
Change-Id: I0a9d8736632084473b57b57b693322447d7be519
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
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>
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>
The output of current "command list" is so long, it's
very difficult for users to find out the commands
they care about.
Add "--group <group-keyword>" option to filter the commands by group
name keyword, like: --group volume, list all openstack.volume.v2
(cinder) commands
That support the scenario that users need to know the current support
commands of some OpenStack services(nova, neutron, cinder and so on) in
OSC.
Change-Id: Id673042729ad36a0cac0b81fb31a3537c24f03fc
Closes-Bug: #1666780
KeyError cause the command "module list --all" failed,
fix it, and do refactor to filter private modules and
reduce the loop times, add related unit tests and
functional tests.
Change-Id: Icd77739502e05b5f763a04a92547497bf82d5d63
Closes-Bug: #1661814
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