summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume/v1/fakes.py
Commit message (Collapse)AuthorAgeFilesLines
* tests: Remove unnecessary nesting of volume resourcesStephen Finucane2022-09-301-576/+536
| | | | | Change-Id: I210ce7534d161e89115e5cb96e42ab7f27170aa1 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* tests: Remove duplicate FakeImagev1ClientStephen Finucane2022-09-301-7/+4
| | | | | | | | I guess this was defined to avoid a circular import. There are easier ways to do this. Change-Id: Iab215a53691298413ea9d10def792008ab9edbce Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* tests: Move fake clients to top of fileStephen Finucane2022-09-301-55/+55
| | | | | | | | These are important and they're easier to identify at the top of the file than nested deep inside. Change-Id: I1569c855fadfe4cdacf83ee07d08922bf3edefbc Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* tests: Rename 'FakeType' -> 'FakeVolumeType'Stephen Finucane2021-06-031-15/+15
| | | | | | | There are more types than just volume types. Change-Id: I6af66f966a221437ff79fabcb0b81fd38586fe67 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Raise flake8-import-order version to latestSean McGinnis2020-01-101-2/+1
| | | | | | | | | | | We had this library capped at a release that is a few years old. Now that we have dropped py2 testing, we can pick up the latest version. This uncovered a few things to clean up. Mostly the fact that mock is now a part of the StdLib unittest since Python 3.3. Change-Id: I27484dd4c25378413ff16e97a35a1a46062357bc Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Use flake8-import-order pluginAkihiro Motoki2017-08-171-1/+2
| | | | | | | | | | | | | | | | In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. It enforces loose checking so it sounds good to use it. This flake8 plugin is already used in tempest. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Setup for unit tests of hacking rules is tweaked to disable flake8-import-order checks. This extension assumes an actual file exists and causes hacking rule unit tests. Change-Id: I12b596820727aeeb379bee16c2bc993dee9eb637
* Add "encryption-*" options in volume type commandsHuanxuan Ao2017-01-141-0/+31
| | | | | | | | | | | | Add "--encryption-provider", "--encryption-cipher", "--encryption-key-size" and "--encryption-control-location" options to "volume type set" and "volume type create" commands. Add "--encryption-type" option to "volume type unset", "volume type list" and "volume type show" commands. Change-Id: I3572635d5913d971a723a62d7790ffe0f20ec39a Implements: bp cinder-command-support Closes-Bug: #1651117
* Outdated test data clean up in volumeHuanxuan Ao2016-11-161-96/+0
| | | | | | | | Now all the volume unit tests (both v1 and v2) are using fake classes. All the old fake data and code can be removed. Change-Id: Ib35ad4b6c94c42a21215e012f80f8978a74a3d18
* Use FakeImage class to replace duplicated image info in volume testHuanxuan Ao2016-10-211-13/+0
| | | | | | | | FakeImage class has been added in image v1 so that we can reuse it in volume v1 unit test to replace the duplicated image info in volume v1 fake. Change-Id: I0f96e568bd65e59241b57704fc2a379319a386d8
* Refactor qos spec unit test in volume v1Huanxuan Ao2016-10-041-0/+26
| | | | | | | Refactor qos spec unit test with FakeQos class in volume v1. Change-Id: Ia76bf41a911457282b293dfaf0af311b1a9194ce
* Add unit tests for backup commands in volume v1Huanxuan Ao2016-09-231-0/+80
| | | | | | | | There was not any unit tests for backup commands in volume v1 so that sometimes some small bugs maybe ignored, this patch add unit tests for them. Change-Id: Ic67c1b80243f7b3d15dabd25e4e4a1b1517a8b59
* Fix unset commands to pass normally when nothing specifiedHuanxuan Ao2016-09-231-0/+78
| | | | | | | | | | | | | | | | After I found this problem appear in "volume unset", I checked all the volume command and also found some same problems. This patch fix them all. The main reason of we ignored this problem before is there was not any tests for it. So I add tests for "nothing unset" for them all to test and aviod this problem. Also, I add unit tests for all snapshot commands in volume v1 by the way in this patch. We will need more tests to avoid some ignored problem. Change-Id: I46775f24643d715e168b30785b8b531c0431a55b Partial-bug: #1588588
* Implement "volume transfer request show/accept" commandHuanxuan Ao2016-09-221-2/+0
| | | | | | | | | | | | Add "volume transfer request show" and "volume transfer accept" commands in volume v1 and v2. Also add the unit tests, docs, release note and functional tests Implements: bp cinder-command-support Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com> Change-Id: I5787fc486b3401307125caa316f517b9c96a95a5
* Refactor volume unit test with FakeVolume class in volume v1Huanxuan Ao2016-09-211-7/+7
| | | | | | | | FakeVolume class has been added in the fake.py in volume v1, this patch refactors the volume command unit tests with the FakeVolume class. Change-Id: Ic3c1a46d5bff9048d0095f5739ae9e5a34ca6b5b
* Replace 'MagicMock' with 'Mock'qtang2016-09-141-5/+5
| | | | | Change-Id: I7aeceede6bd3cb88cf04f398454f9758dbee20f1 Closes-Bug: #1475722
* Merge "Add unit test for volume type in volume v1"Jenkins2016-09-121-0/+74
|\
| * Add unit test for volume type in volume v1Huanxuan Ao2016-09-111-0/+74
| | | | | | | | | | | | | | | | Add unit test for volume type commands (create/delete/show/list/set/unset) in volume v1 Change-Id: I6ff1f1c7482bd0b4bfec5b4a1496807b722fa047
* | Implement "volume transfer request delete" commandHuanxuan Ao2016-09-111-0/+37
| | | | | | | | | | | | | | | | | | | | Add "volume transfer request delete" command in volume v1 and v2. Also add the unit tests, docs, release note and functional tests Change-Id: Ic3d375bc8df3312fac53c1800d75f48376b8c91c Implements: bp cinder-command-support Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
* | Implement "volume transfer request create" commandHuanxuan Ao2016-09-111-2/+5
|/ | | | | | | | | | Add "volume transfer request create" command in volume v1 and v2. Also add the unit tests, docs, release note and functional tests Change-Id: If362df1acf214efdf6ba129cd917d33eb54e1030 Implements: bp cinder-command-support Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
* Support error handling for delete commands in volume v1Huanxuan Ao2016-09-111-0/+156
| | | | | | | | | Some delete commands in volume v1 support multi delete but do not support error handling, this patch fixes them, and this patch also refactor (or add new) unit tests for some delete commands in volume v1. Change-Id: Ia8177698f8733cfe75ea0ff00eee8fdc0820f62e
* move unit tests to new "unit" test moduleSteve Martinelli2016-09-081-0/+280
this will better isolate the unit tests from the functional tests. unfortunately, the "integration" tests had to be lumped into the "unit" tests since we need the separation in testr.conf Change-Id: Ifd12198c1f90e4e3c951c73bfa1884ab300d8ded