fixes assert statements in tests (#59998)

(cherry picked from commit d00aaf66d7)
This commit is contained in:
Wojciech Wypior 2019-08-07 14:52:41 +01:00 committed by Toshio Kuratomi
parent c087030e5c
commit 99f9eab19d
6 changed files with 10 additions and 10 deletions

View file

@ -307,7 +307,7 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_interval_larger_than_new_timeout(self, *args):
set_module_args(dict(
@ -337,7 +337,7 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_send(self, *args):
set_module_args(dict(

View file

@ -246,7 +246,7 @@ class TestManagerEcho(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_interval_larger_than_new_timeout(self, *args):
set_module_args(dict(
@ -275,7 +275,7 @@ class TestManagerEcho(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_timeout(self, *args):
set_module_args(dict(

View file

@ -253,7 +253,7 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_interval_larger_than_new_timeout(self, *args):
set_module_args(dict(
@ -282,7 +282,7 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_timeout(self, *args):
set_module_args(dict(

View file

@ -305,7 +305,7 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_interval_larger_than_new_timeout(self, *args):
set_module_args(dict(
@ -335,7 +335,7 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "must be less than" in str(ex)
assert "must be less than" in str(ex.value)
def test_update_send(self, *args):
set_module_args(dict(

View file

@ -231,4 +231,4 @@ class TestManager(unittest.TestCase):
with pytest.raises(F5ModuleError) as ex:
mm.exec_module()
assert "Multiple occurrences of hostname" in str(ex)
assert "Multiple occurrences of hostname" in str(ex.value)

View file

@ -105,7 +105,7 @@ class TestParameters(unittest.TestCase):
p = ModuleParameters(params=args)
with pytest.raises(F5ModuleError) as ex:
assert p.allow_service == ['grp', 'tcp:80', 'udp:53']
assert 'The provided protocol' in str(ex)
assert 'The provided protocol' in str(ex.value)
def test_api_parameters(self):
args = dict(