From 156f6af95ede730d2e1a9d2c935c830cf3cfc96e Mon Sep 17 00:00:00 2001 From: Toni Karppi Date: Thu, 21 Feb 2019 12:51:21 +0100 Subject: [PATCH] Add test to as_interface when no cls or methods The `as_interface` function requires that an argument be provided for at least one of the parameters `cls` or `methods`. There was no test that tested the case when neither of these arguments were provided. --- test/base/test_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/base/test_utils.py b/test/base/test_utils.py index b27379248d..e96162703b 100644 --- a/test/base/test_utils.py +++ b/test/base/test_utils.py @@ -2305,6 +2305,10 @@ class AsInterfaceTest(fixtures.TestBase): class Object(object): pass + def test_no_cls_no_methods(self): + obj = object() + assert_raises(TypeError, util.as_interface, obj) + def test_instance(self): obj = object() assert_raises(TypeError, util.as_interface, obj, cls=self.Something) -- 2.47.2