diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-02-29 16:50:54 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-03-03 21:07:08 +0800 |
| commit | b58dd4f17f60b3c6347683b619c093b8d1a40c0b (patch) | |
| tree | b4662ad2516501497ba8fc4a4174026f62d841b0 /openstackclient/tests/volume/v2/test_volume.py | |
| parent | 977eb4f1a659b7a3ea913eb6f145577975dfe36d (diff) | |
| download | python-openstackclient-b58dd4f17f60b3c6347683b619c093b8d1a40c0b.tar.gz | |
[Volume] Check return value is None in volume unit tests
take_action() in commands inheriting from Command returns nothing.
So we should assert the return is None in the unit tests of these
commands.
Change-Id: Idd961a5fa3db825353700837a559621d17f782c5
Partial-Bug: #1550636
Diffstat (limited to 'openstackclient/tests/volume/v2/test_volume.py')
| -rw-r--r-- | openstackclient/tests/volume/v2/test_volume.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openstackclient/tests/volume/v2/test_volume.py b/openstackclient/tests/volume/v2/test_volume.py index cbca09b2..a836f79e 100644 --- a/openstackclient/tests/volume/v2/test_volume.py +++ b/openstackclient/tests/volume/v2/test_volume.py @@ -396,11 +396,12 @@ class TestVolumeDelete(TestVolume): verifylist = [ ("volumes", [volumes[0].id]) ] - parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + result = self.cmd.take_action(parsed_args) + self.volumes_mock.delete.assert_called_with(volumes[0].id) + self.assertIsNone(result) def test_volume_delete_multi_volumes(self): volumes = self.setup_volumes_mock(count=3) @@ -409,14 +410,13 @@ class TestVolumeDelete(TestVolume): verifylist = [ ('volumes', arglist), ] - parsed_args = self.check_parser(self.cmd, arglist, verifylist) - self.cmd.take_action(parsed_args) + result = self.cmd.take_action(parsed_args) calls = [call(v.id) for v in volumes] - self.volumes_mock.delete.assert_has_calls(calls) + self.assertIsNone(result) class TestVolumeList(TestVolume): |
