summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Use unittest.mock instead of third party mockSean McGinnis2020-06-051-1/+1
| | | | | | | | Now that we no longer support py27, we can use the standard library unittest.mock module instead of the third party mock lib. Change-Id: Ia41326a601dfd72750bd81c3ebee9ec5884ad91b Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Tests: Don't write bash-completion cache filesEric Harney2019-02-261-0/+14
| | | | | | | | | Mock out writing of bash-completion cache files during unit tests. Related-Bug: #1817782 Change-Id: I944862c30fb4684dd034eba6953e9302d2d22439
* Switch to keystoneauthSteve Martinelli2016-07-231-5/+14
| | | | | | | | | | | move cinderclient to keystoneauth as keystoneclient's auth session, plugins and adapter code has been deprecated. Co-Authored-By: Paulo Ewerton <pauloewerton@lsd.ufcg.edu.br> Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com> Co-Authored-By: Jamie Lennox <jamielennox@gmail.com> Change-Id: Id4bf0e2088e8ad99e83cd4f9b8549c2aca1f65a2
* Fix batch deleting issue in volume_type.unset_keys()Rui Chen2016-07-061-2/+2
| | | | | | | | | | | cinderclient volume_type.unset_keys() only delete the first key even if multiple keys are applied. The response of manager._delete() is tuple object, it is not "None" if the deleting success, so the batch operation would be broken when the first key is deleted successfully. The patch fix this issue. Change-Id: I60378a32cdc52aacdf869d69b246dec7eb6cdb77 Closes-Bug: #1596511
* Merge "Fix argument order for assertEqual to (expected, observed)"Jenkins2016-06-141-3/+3
|\
| * Fix argument order for assertEqual to (expected, observed)reedip2016-06-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | assertEqual expects that the arguments provided to it should be (expected, observed). If a particluar order is kept as a convention, then it helps to provide a cleaner message to the developer if Unit Tests fail. The following patch fixes this issue. TrivialFix Change-Id: I817a654733e0f3886ca85778a49aa579592f60ff Closes-Bug: #1259292
* | Fix upload_to_image method1.7.1Ivan Kolodyazhny2016-05-201-0/+5
|/ | | | | | | | | | | Commit Ie639179c5bbbaca4de62b42b368830afcfd8f7ac introduced 'visibility' and 'protected' params. These params should be used only with v3.1 microversion. Also these changes break current v2 users. This patch fixes these issues. Closes-Bug: #1584056 Change-Id: I0574631791c475bbefdb6e7d1647a20d0759df64
* Return wrapper classes with request_ids attributeAnkit Agrawal2016-01-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Return appropriate wrapper classes with request_ids attribute from base class. Note: In cinderclient/base.py->_update method will return None for qos_specs->unset_keys method and for all other cases it returns body of type dict. At few places, wherever the _update method is called, it converts the return value back to the resource class and in all other cases the same return value is returned back to the caller. It's not possible to return request_ids with None so for all cases object of DictWithMeta will be returned from this method. Second approach would be to return (resp, body) tuple from _update method and wherever this method is called, return the appropriate object. These changes will affect v1 version and since v1 is already deprecated the above approach sounds logical. This change is required to return 'request_id' from client to log request_id mappings of cross projects. Change-Id: If73c47ae2c99dea2a0b1f25771f081bb4bbc26f1 Partial-Implements: blueprint return-request-id-to-caller
* Move unit tests into test directoryJohn Griffith2015-03-231-0/+99
This is the first step of moving functional testing into the project tree. This change just moves all of the unit tests to be under a dedicated tests/unit directory. Follow up patches will add the functional directory and start moving tempest CLI tests there. Change-Id: I9dc0b8f761676c1b3bbdeb03e2f44b35f75c693e