summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit/test_http.py
Commit message (Collapse)AuthorAgeFilesLines
* Use unittest.mock instead of third party mockSean McGinnis2020-06-051-2/+3
| | | | | | | | 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>
* Replace bypass_url with os_endpointIan Wienand2020-03-251-2/+2
| | | | | | | | The --bypass-url argument was removed with I3b951cc4eb3adff23f3d2cbe674971816261ef56 so this name does not make sense now. Replace with os_endpoint. Change-Id: Ifa889cc2e885e9c621c8494995b2020195b696ca
* Handle auth redirectsSean McGinnis2019-04-181-2/+23
| | | | | | | | | | | | | | Our checking for keystone v2 and v3 was causing v2 tests to go down the v1 code path. Fixing this surfaced a couple of long standing issues with our v2/v3 handling of redirects and getting auth info. This fixes our version identification, fixes extracting redirect location for response headers, and returning the auth_url to calling code. Change-Id: I939ff027bf43e513e338bff1e99ca41fa52637b6 Closes-bug: #1825372 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* support global_request_id in constructorSean Dague2017-05-251-4/+29
| | | | | | | | | | This allows a global_request_id to be created in the constructor which will be passed on all subsequent calls to support cross service request tracking. oslo spec I65de8261746b25d45e105394f4eeb95b9cb3bd42 Change-Id: Ib271ac01c2a4a36e611ae9181ae93305f2318680
* Fix noauth supportIvan Kolodyazhny2017-03-241-3/+3
| | | | | | | | | | | | | | | | | | | | | This patch includes several improvements: 1. Use keystoneauth1 plugin mechanism for auth plugins. 2. Implements CinderNoAuthPlugin. 3. Deletes non-working cinderclient.auth_plugin module. 4. Deprecates --bypass-url in flavor of --os-endpoint to be consistent with keystoneauth1 plugins. 5. Deprecates in --os-auth-system in falvor of --os-auth-type to be consistent with keystoneauth1 plugins. Both bypass_url and os_auth_system params are not changed for client objects to not break backward compatibility for Python API. How to use noauth with cinderclient CLI: OS_USER_ID=userid OS_PROJECT_ID=projectis cinder --os-auth-type noauth --os-endpoint=http://localhost:8776/v2 list Change-Id: I3be59a5a39235acbc3334e0a0b797081507a5c88 Closes-Bug: #1657156
* Fix test_auth_with_keystone_v3 testGorka Eguileor2017-01-251-1/+7
| | | | | | | | | | | | | | | | Test is subject to spurious errors due to an incorrect data check. The check is assuming that a call to json.dumps with different dicts will always generate the same string, which is incorrect. This patch tests the JSON data that is sent in the request on its own based on converting the passed JSON string to a dict and comparing expected and actual dicts instead of strings. TrivialFix Closes-Bug: #1658704 Change-Id: I386cfee2e2c1dc2971d8a760b485505a90f6f120
* Support Keystone V3 with HttpClientwangxiyuan2016-12-241-0/+48
| | | | | | | | The http way doesn't work with keystone v3. This patch update the HttpClient to support it. Closes-bug: #1546280 Change-Id: Iefa1aafb796609aca076ed6ab73d02c92b9198d0
* Switch to keystoneauthSteve Martinelli2016-07-231-20/+8
| | | | | | | | | | | 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
* Cinder client should retry with Retry-After valueYuriy Nesenenko2016-07-061-0/+43
| | | | | | | | | | | | | | | | | | | If a request fails but the response contains a "Retry-After", the cinder client should wait the amount of time and then retry. Cinder client should report a warning to user and continue with retry, so that user can cancel the operation if not interested in retry. The value in "Retry-After" header will be in seconds or GMT value, client should handle both the cases. How many times client should retry will be controlled by user through "--retries" argument to cinder api example, $ cinder --retries 3 availability-zone-list If request was not sucessful within the retries, client should raise the exception. Change-Id: I99af957bfbbe3a202b148dc2fcafdd20b5d7cda0 Partial-Bug: #1263069
* Fix argument order for assertEqual to (expected, observed)reedip2016-06-141-2/+2
| | | | | | | | | | | | 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
* Move unit tests into test directoryJohn Griffith2015-03-231-0/+280
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