From d00aaf66d7f224d24bc66b1de751de086a3771b0 Mon Sep 17 00:00:00 2001 From: Wojciech Wypior Date: Wed, 7 Aug 2019 14:52:41 +0100 Subject: [PATCH] fixes assert statements in tests (#59998) --- test/units/modules/network/f5/test_bigip_monitor_tcp.py | 4 ++-- test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py | 4 ++-- .../modules/network/f5/test_bigip_monitor_tcp_half_open.py | 4 ++-- test/units/modules/network/f5/test_bigip_monitor_udp.py | 4 ++-- test/units/modules/network/f5/test_bigip_remote_syslog.py | 2 +- test/units/modules/network/f5/test_bigip_selfip.py | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/units/modules/network/f5/test_bigip_monitor_tcp.py b/test/units/modules/network/f5/test_bigip_monitor_tcp.py index f3db45a6a42..56ee56a8e15 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_tcp.py +++ b/test/units/modules/network/f5/test_bigip_monitor_tcp.py @@ -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( diff --git a/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py b/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py index cf500ece767..528b2cd792e 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py +++ b/test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py @@ -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( diff --git a/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py b/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py index 9a652f8c00c..286962ccc42 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py +++ b/test/units/modules/network/f5/test_bigip_monitor_tcp_half_open.py @@ -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( diff --git a/test/units/modules/network/f5/test_bigip_monitor_udp.py b/test/units/modules/network/f5/test_bigip_monitor_udp.py index c17a31133c7..159b74b45bd 100644 --- a/test/units/modules/network/f5/test_bigip_monitor_udp.py +++ b/test/units/modules/network/f5/test_bigip_monitor_udp.py @@ -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( diff --git a/test/units/modules/network/f5/test_bigip_remote_syslog.py b/test/units/modules/network/f5/test_bigip_remote_syslog.py index fc3d363e63c..0d87f0a8092 100644 --- a/test/units/modules/network/f5/test_bigip_remote_syslog.py +++ b/test/units/modules/network/f5/test_bigip_remote_syslog.py @@ -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) diff --git a/test/units/modules/network/f5/test_bigip_selfip.py b/test/units/modules/network/f5/test_bigip_selfip.py index 2de0c6b1dc0..026197c92d5 100644 --- a/test/units/modules/network/f5/test_bigip_selfip.py +++ b/test/units/modules/network/f5/test_bigip_selfip.py @@ -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(