summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_cliutils.py
Commit message (Collapse)AuthorAgeFilesLines
* Update to use flake8.Monty Taylor2013-03-241-61/+89
| | | | | | | flake8 is pluggable and handles pep8 and pyflakes, as well as configuration through tox.ini. It also removes the need for flakes.py. Change-Id: If5f7d8ad348b4fb8119fa4ec7b5e9d17bdc72a39
* Replace direct use of testtools BaseTestCase.Monty Taylor2013-01-241-3/+2
| | | | | | | | | Using the BaseTestCase across the tests in the tree lets us put in log fixtures and consistently handle mox and stubout. Part of blueprint grizzly-testtools. Change-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0
* Use testtools as test base class.Monty Taylor2013-01-241-2/+2
| | | | | | | | | | | | | On the path to testr migration, we need to replace the unittest base classes with testtools. Replace tearDown with addCleanup, addCleanup is more resilient than tearDown. The fixtures library has excellent support for managing and cleaning tempfiles. Use it. Replace skip_ with testtools.skipTest Part of blueprint grizzly-testtools. Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98
* Add a CLI argument validation utilityMark McLoughlin2012-11-291-0/+398
blueprint oslo-cliutils In nova-manage and cinder-manage, we allow command arguments to be passed as optional or positional arguments. e.g. $> nova-manage floating create 10.0.0.1/28 $> nova-manage floating create --ip_range 10.0.0.1/28 are equivalent. Once nova-manage has collected those arguments, it calls the appropriate command function with them as positional and keyword arguments. If the user forgets to supply a required argument, they merely get a TypeError with little useful information. Improve the usability of these commands using a new utility function to check that the required arguments have been supplied and raise a useful exception if not. Change-Id: If6e4a9f222a30472bbfbcd06859865bd4e37e139