fixes assert statements in tests (#59998)
This commit is contained in:
parent
18e0d679dd
commit
d00aaf66d7
6 changed files with 10 additions and 10 deletions
|
@ -307,7 +307,7 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_interval_larger_than_new_timeout(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
@ -337,7 +337,7 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_send(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
|
|
@ -246,7 +246,7 @@ class TestManagerEcho(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_interval_larger_than_new_timeout(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
@ -275,7 +275,7 @@ class TestManagerEcho(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_timeout(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
|
|
@ -253,7 +253,7 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_interval_larger_than_new_timeout(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
@ -282,7 +282,7 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_timeout(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
|
|
@ -305,7 +305,7 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_interval_larger_than_new_timeout(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
@ -335,7 +335,7 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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):
|
def test_update_send(self, *args):
|
||||||
set_module_args(dict(
|
set_module_args(dict(
|
||||||
|
|
|
@ -231,4 +231,4 @@ class TestManager(unittest.TestCase):
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
mm.exec_module()
|
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)
|
p = ModuleParameters(params=args)
|
||||||
with pytest.raises(F5ModuleError) as ex:
|
with pytest.raises(F5ModuleError) as ex:
|
||||||
assert p.allow_service == ['grp', 'tcp:80', 'udp:53']
|
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):
|
def test_api_parameters(self):
|
||||||
args = dict(
|
args = dict(
|
||||||
|
|
Loading…
Reference in a new issue