diff --git a/f5/bigip/tm/sys/config.py b/f5/bigip/tm/sys/config.py index cf0895da9..149bd9544 100644 --- a/f5/bigip/tm/sys/config.py +++ b/f5/bigip/tm/sys/config.py @@ -27,6 +27,7 @@ """ from f5.bigip.mixins import CommandExecutionMixin from f5.bigip.resource import UnnamedResource +from f5.sdk_exception import UnsupportedMethod class Config(UnnamedResource, @@ -43,6 +44,6 @@ def update(self, **kwargs): :raises: UnsupportedOperation ''' - raise self.UnsupportedMethod( + raise UnsupportedMethod( "%s does not support the update method" % self.__class__.__name__ ) diff --git a/test/functional/tm/sys/test_config.py b/test/functional/tm/sys/test_config.py index c6654b936..b2ea9ebd3 100644 --- a/test/functional/tm/sys/test_config.py +++ b/test/functional/tm/sys/test_config.py @@ -13,8 +13,17 @@ # limitations under the License. # +from f5.sdk_exception import UnsupportedMethod + +import pytest + class TestConfig(object): def test_save(self, bigip): c = bigip.sys.config c.exec_cmd('save') + + def test_update(selfself, mgmt_root): + with pytest.raises(UnsupportedMethod) as ex: + mgmt_root.tm.sys.config.update(foo="bar") + assert 'does not support the update method' in ex.value.message