Test take_action() in unit tests

Bug #1553468 reported by Tang Chen
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Tang Chen

Bug Description

Some of the unit tests test run(), but not take_action().

For example, in openstackclient/tests/volume/v1/test_volume.py, there is:

    def test_volume_set_size_smaller(self):
        ......

        result = self.cmd.run(parsed_args)

        self.assertEqual(0, result)
        ......

run() is defined in class Command in cliff. We don't need to test it in OSC unit tests. On the contrary, we should test take_action(), which is overwritten in each command classes in OSC.

Tang Chen (tangchen)
Changed in python-openstackclient:
assignee: nobody → Tang Chen (tangchen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/288861

Changed in python-openstackclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/288861
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=eb1574281b84e86ee4c4b65d900e1de82c24471e
Submitter: Jenkins
Branch: master

commit eb1574281b84e86ee4c4b65d900e1de82c24471e
Author: Tang Chen <email address hidden>
Date: Sat Mar 5 17:12:42 2016 +0800

    Test take_action() instead of run() in unit tests

    Some of the unit tests test run(), but not take_action().

    For example, in openstackclient/tests/volume/v1/test_volume.py, there is:

        def test_volume_set_size_smaller(self):
            ......

            result = self.cmd.run(parsed_args)

            self.assertEqual(0, result)
            ......

    run() is defined in class Command in cliff. We don't need to test it in OSC
    unit tests. On the contrary, we should test take_action(), which is
    overwritten in each command classes in OSC.

    Change-Id: If07e89953d40ac530f08cbb1ec05f5805171364b
    Closes-bug: #1553468

Changed in python-openstackclient:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-openstackclient 2.4.0

This issue was fixed in the openstack/python-openstackclient 2.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.