summaryrefslogtreecommitdiff
path: root/openstackclient/tests/common/test_parseractions.py
Commit message (Collapse)AuthorAgeFilesLines
* Use assertEqual() instead of assertDictEqual()Tang Chen2016-07-251-1/+1
| | | | | | | | | | | 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: Ice343b2ce468acae39d2ad79f7121503e3627656
* osc-lib: parseractionsDean Troyer2016-06-131-0/+3
| | | | | | | Leave parseractions.py and test_parseractions.py as a sanity check during the deprecation period. Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
* Error handling for KeyValueAction class.Huanxuan Ao2016-06-081-10/+7
| | | | | | | | | | | | 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: I14e64922faa7e083bc8b5e7e1cac41ef8117c224 Closes-Bug: #1589935
* Use assertItemsEqual() instead of assertListEqual()Tang Chen2016-03-141-10/+2
| | | | | | | | assertListEqual() is order sensitive. So we need to sort the lists before we compare them. Use assertItemsEqual() instead is better. Change-Id: I9eaa98716c7401f5b099b007438acc916dae619b
* Add MultiKeyValueAction to custom parser actionTang Chen2016-02-271-0/+129
| | | | | | | | | | | | | | Class MultiKeyValueAction will be used to parse arguments like this: --route destination=xxx,gateway=xxx --route destination=yyy,gateway=yyy The result is a list like this: [{destination:xxx, gateway:xxx}, {destination:yyy, gateway:yyy}] This action also contain validation of the parameters. Change-Id: Ie3aa8635c6a13fc2e429fe6922acd681dc7244cf
* Refactor: Initialize parser in setUp() in TestNonNegativeActionTang Chen2015-12-281-26/+10
| | | | Change-Id: I12846acc4450d31d19897bbdfc6846bde8c8f2ce
* Refactor: Initialize parser in setUp() in TestKeyValueActionTang Chen2015-12-281-52/+9
| | | | | | | | No need to initialize parser in each test case. Do it in setUp(). Also remove the test_default_values case because it could be tested in the test_good_values case. Change-Id: Ia2ed7c9e46bf6baabbd62b9d50511c5e8103e5e2
* Replace assertEqual(None, *) with assertIsNone(*)Xi Yang2015-12-251-1/+1
| | | | | | | | This patch is going to replace assertEqual(None, *) with assertIsNone(*) in unit test code to have more clear messages in case of failure. Change-Id: I6f85498347e8fc7cad5ea7afb832b9acda7daafc
* Fix the bug of "openstack console log show"xiexs2015-11-091-0/+55
| | | | | | | | The behaviors are inconsistent while different negative line numbers specified. Change-Id: I2573f3e789f5603c896758971830ffc0b94c5e2b Closes-Bug: #1512263
* fix the wrong order of assertEqual argswanghong2015-01-271-1/+1
| | | | | | Let's fix them thoroughly. Change-Id: I8a1f042fb614b05c9836a49041f3883638b870b0
* Fixed several typos throughout the codebaseAlex Gaynor2014-05-211-1/+1
| | | | Change-Id: I048ee857fc1215fea7f60978364894e1b5abdf66
* Move tests into project package.Monty Taylor2013-06-301-0/+104
There are several reasons for this. One is that the majority of OpenStack packages behave this way. The second is that it makes writing software that extends something easier to test (which is a clear usecase for openstackclient) And third, tests/__init__.py implies a global package named "tests" - which I'm pretty sure we're not providing. Change-Id: Ic708ffd92aea78c2ffc1a8579af0587af4fca4ff