assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: I631fb791ece68aac607aeae56ce96a0d472964c8
This is required to support things like the '--hint' option for
'openstack server create', which allows you to specify arguments
multiple times.
Change-Id: If73cab759fa09bddf1ff519923c5972c3b2052b1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Based on [1], the following class is transitioned to
osc-lib as it may be required in other scenarios as well.
[1]:https://review.openstack.org/#/c/356263/13
* Tests rewritten to be more straightforward in checking combinations
and expected results.
Change-Id: I293b5b25adcf8ed6815608db4f280ee4e3da5da9
null key is the invalid input when setting property
in the openstack components.
Prevent null key setting for property in
openstackclient.
Change-Id: I8ec72664b5393ffef71fffa4bd1cd3c303e86a52
Related-Bug: #1558690
In unittest2, assertDictEqual() is implemented by
using != operator to compare two dicts. So is
assertEqual() in testtools. assertEqual() in
testtools is able to handle dict, list, set and so
on. So we just call assertEqual() to make the unit
tests simpler.
Change-Id: I5eeeebced716f2065e81d72a9972392ae3a45d89
The set --property command requires that the input match
the "key=value" type, but if the type don't match, the return
value will be None, and the command still can be implemented
successfully, this may confuse the users. I think we should
raise exception if the argument type don't match "key=value".
So I make some changes in KeyValueAction class in this patch.
Change-Id: If4a00ae6da08bc12362ef2fc82012b42839141f0