Fix DisplayCommandBase comments for cliff Command subclass tests

As bug #1477199 describes, the wrong comment below is all over the
unit test code of OSC.

    # DisplayCommandBase.take_action() returns two tuples

There is no such class named DisplayCommandBase in OSC. It is in cliff.

All OSC command classes inherit from the base classes in cliff,
class Command, class Lister and class ShowOne. It is like this:

Object
|--> Command
     |--> DisplayCommandBase
          |--> Lister
          |--> ShowOne

take_action() is an abstract method of class Command, and generally is
overwritten by subclasses.
* Command.take_action() returns nothing.
* Lister.take_action() returns a tuple which contains a tuple of columns
  and a generator used to generate the data.
* ShowOne.take_action() returns an iterator which contains a tuple of
  columns and a tuple of data.

So, this problem should be fixed in 3 steps:
1. Remove all DisplayCommandBase comments for tests of classes inheriting
   from class Command in cliff as it returns nothing.
2. Fix all DisplayCommandBase comments for tests of classes inheriting
   from class Lister in cliff. Lister.take_action() returns a tuple and
   a generator.
3. Fix all DisplayCommandBase comments for tests of classes inheriting
   from class ShowOne in cliff. ShowOne.take_action() returns two tuples.

This patch finishes step 1 in all but identity tests. There are too many
such comments in identity tests. So fix them all in another patch.

Change-Id: I9849baa8141ea8af2042a69afd540b77ce6ae6bd
Partial-bug: #1477199
This commit is contained in:
Tang Chen 2016-02-09 18:27:48 +08:00
parent 624c39ab1b
commit 43f80505cb
3 changed files with 0 additions and 22 deletions
openstackclient/tests

@ -230,7 +230,6 @@ class TestImageDelete(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
self.images_mock.delete.assert_called_with(
@ -456,7 +455,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
# Verify update() was not called, if it was show the args
@ -517,7 +515,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -545,7 +542,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -570,7 +566,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {

@ -435,7 +435,6 @@ class TestImageDelete(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
self.images_mock.delete.assert_called_with(
@ -730,7 +729,6 @@ class TestRemoveProjectImage(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
self.image_members_mock.delete.assert_called_with(
image_fakes.image_id,
@ -750,7 +748,6 @@ class TestRemoveProjectImage(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
self.image_members_mock.delete.assert_called_with(
image_fakes.image_id,
@ -808,7 +805,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -876,7 +872,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -904,7 +899,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -929,7 +923,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -963,7 +956,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -991,7 +983,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -1015,7 +1006,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -1044,7 +1034,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -1075,7 +1064,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {
@ -1101,7 +1089,6 @@ class TestImageSet(TestImage):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
kwargs = {

@ -582,7 +582,6 @@ class TestVolumeSet(TestVolume):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
# Set expected values
@ -608,7 +607,6 @@ class TestVolumeSet(TestVolume):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
# Set expected values
@ -634,7 +632,6 @@ class TestVolumeSet(TestVolume):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
# Set expected values
@ -700,7 +697,6 @@ class TestVolumeSet(TestVolume):
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
# DisplayCommandBase.take_action() returns two tuples
self.cmd.take_action(parsed_args)
# Set expected values