Fix broken exception handling on unit tests
Unit tests are now broken for python-manilaclient. We used to expect an argparse exception for some cases but now we should be expecting a ParserException. Change-Id: Ibf47932ff848906d8d71a0affe2af564ba962abb
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
|
||||||
import ddt
|
import ddt
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
@@ -1052,7 +1051,7 @@ class TestShareList(TestShare):
|
|||||||
verifylist = [
|
verifylist = [
|
||||||
("limit", -2),
|
("limit", -2),
|
||||||
]
|
]
|
||||||
self.assertRaises(argparse.ArgumentTypeError, self.check_parser,
|
self.assertRaises(osc_utils.ParserException, self.check_parser,
|
||||||
self.cmd, arglist, verifylist)
|
self.cmd, arglist, verifylist)
|
||||||
|
|
||||||
def test_share_list_name_description_filter(self):
|
def test_share_list_name_description_filter(self):
|
||||||
|
@@ -11,21 +11,17 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import exceptions as osc_exceptions
|
from osc_lib import exceptions as osc_exceptions
|
||||||
|
|
||||||
from osc_lib import utils as oscutils
|
from osc_lib import utils as oscutils
|
||||||
|
|
||||||
from manilaclient.osc import utils
|
|
||||||
|
|
||||||
from manilaclient import api_versions
|
from manilaclient import api_versions
|
||||||
|
from manilaclient.osc import utils
|
||||||
from manilaclient.osc.v2 import share_groups as osc_share_groups
|
from manilaclient.osc.v2 import share_groups as osc_share_groups
|
||||||
|
from manilaclient.tests.unit.osc import osc_utils
|
||||||
from manilaclient.tests.unit.osc.v2 import fakes as manila_fakes
|
from manilaclient.tests.unit.osc.v2 import fakes as manila_fakes
|
||||||
|
|
||||||
|
|
||||||
@@ -795,7 +791,7 @@ class TestShareGroupList(TestShareGroup):
|
|||||||
verifylist = [
|
verifylist = [
|
||||||
("limit", -2),
|
("limit", -2),
|
||||||
]
|
]
|
||||||
self.assertRaises(argparse.ArgumentTypeError, self.check_parser,
|
self.assertRaises(osc_utils.ParserException, self.check_parser,
|
||||||
self.cmd, arglist, verifylist)
|
self.cmd, arglist, verifylist)
|
||||||
|
|
||||||
# TODO(archanaserver): Add test cases for share-server-id,
|
# TODO(archanaserver): Add test cases for share-server-id,
|
||||||
|
Reference in New Issue
Block a user