Commit Graph

6 Commits

Author SHA1 Message Date
haixin 3831e5500f remove usage of six library from unit tests
Replace six with Python 3 style code.

Change-Id: I5077e71663f6b60bd774f30fcf64b36d4078cf8e
2021-01-28 10:47:40 +08:00
Goutham Pacha Ravi 598223985a Use unittest.mock instead of third party lib
mock was adopted into standard python
in version 3.3 [1]. Since manila no longer
supports python2.7, we can use the inbuilt
mock package rather than the third party
lib.

Fix some issues with imports that weren't
following our import conventions of grouping
imports [3]

Add a hacking test to ensure we don't regress
on this.

[1] https://docs.python.org/3/library/unittest.mock.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html
[3] https://docs.openstack.org/hacking/latest/user/hacking.html#imports

Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Change-Id: If857a49fbf526983e712282a25d7e8bef5093533
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-17 16:24:27 -07:00
Goutham Pacha Ravi 0d8310ec7a Fix version selector when for proxy-style URLs
When manila API is served behind a proxy, the
"script_name" in the request can have the proxy
component in it. So, this patch fixes the version
selection logic by looking for the version in the
script name string instead of equivalence.

In addition, this patch adds some missing unit
tests and fixes tests that invoke a mocked
wsgi app for testing request context.

Change-Id: I0363d7174f3d7ddefa8ced59b182faed665e9c36
Partial-Bug: #1815038
Closes-Bug: #1818081
2019-03-11 16:42:25 +00:00
zhongjun 6d29762f87 Delete unused test check
TrivialFix

Change-Id: Id93a5062c48e99afc22594f05cbf29cffce2494e
2018-06-09 22:34:35 +00:00
zhongjun fb48ddf3ff Remove unused function in test_share_snapshot_instances file
Remove unused _get_request function in test_share_snapshot_instances
file.

TrivialFix
Change-Id: Iaca1bb541a34af862b938e17e4a56d53de7a9cc3
2017-05-24 16:46:14 +08:00
zhongjun 8a487bf95d Add snapshot instances admin APIs
Add new API entry points for share snapshot instances:
- share-snapshot-instance-list
- share-snapshot-instance-show
- share-snapshot-instance-reset-status

APIImpact
DocImpact

Implements: blueprint snapshot-instances
Change-Id: Ica1e81012f19926e0f1ba9cd6d8eecc5fbbf40b5
2016-07-29 11:21:35 +08:00