vpn: H202 assertRaises Exception too broad

Bug #1217840 reported by Akihiro Motoki on 2013-08-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Low
Akihiro Motoki

Bug Description

test-requirement.txt was updated and hacking 0.7.0 add the new check:
H202 assertRaises Exception too broad.

It is better to address them and enable H202 check in tox.ini.
This is a preparation for syncing test-requirement.txt to the global requirements.

./neutronclient/tests/unit/vpn/test_cli20_ipsec_site_connection.py:168:10: H202 assertRaises Exception too broad
        self.assertRaises(
         ^
./neutronclient/tests/unit/vpn/test_cli20_ipsec_site_connection.py:215:10: H202 assertRaises Exception too broad
        self.assertRaises(
         ^
./neutronclient/tests/unit/vpn/test_utils.py:124:10: H202 assertRaises Exception too broad
        self.assertRaises(Exception,
         ^
./neutronclient/tests/unit/vpn/test_utils.py:130:10: H202 assertRaises Exception too broad
        self.assertRaises(Exception,
         ^

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

Changed in python-neutronclient:
status: New → In Progress

Reviewed: https://review.openstack.org/44031
Committed: http://github.com/openstack/python-neutronclient/commit/081b55b7aea3b97cde8ecd92ce87dfcd809b50a1
Submitter: Jenkins
Branch: master

commit 081b55b7aea3b97cde8ecd92ce87dfcd809b50a1
Author: Akihiro MOTOKI <email address hidden>
Date: Wed Aug 28 20:23:02 2013 +0900

    Fix H202 hacking check in VPN client

    Closes-Bug: #1217840

    H202 was added recently in hacking 0.7.0.

    Change-Id: Icaa73bb3483844a8d50e8fa1bf01495375c49dc9

Changed in python-neutronclient:
status: In Progress → Fix Committed
ZhiQiang Fan (aji-zqfan) wrote :

since neutron-core approve this review https://review.openstack.org/44031 first, it actually does not pass ut, because all ut all run under neutronclient.tests, not tests.unit.vpn

besides, i think there are still missing something related to this patch so i will check and upload a new patch to close this bug

Changed in python-neutronclient:
status: Fix Committed → In Progress
ZhiQiang Fan (aji-zqfan) wrote :

bug 1219192 is filed to handle it

Changed in python-neutronclient:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki) wrote :

I noticed it when I tried to rebase your patch. There is several things to be fixed. This is filed as bug 1219192 .

- Some validation logic in VPNaaS CLI still raise ValueError or KeyError.
- There is a test in VPNaaS CLI tries to connect the neutron server and it raises ConnectionError. It breask the tests.

I posted the fix as a part of your patch moving VPN unittests.

Akihiro Motoki (amotoki) on 2014-10-17
Changed in python-neutronclient:
milestone: none → 2.3.0-2.3.4
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers