fixes assert statements in tests (#59998)

pull/57504/merge
Wojciech Wypior 5 years ago committed by Tim Rupp
parent 18e0d679dd
commit d00aaf66d7

@ -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(

@ -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(

@ -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(

@ -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(

@ -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)

@ -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(

Loading…
Cancel
Save