def test_getattr_sdk_method_negative(self): name = 'method' def func(self): pass attr = types.MethodType(func, object) with pytest.raises(AttributeError): sdk_utils.getattr_sdk(attr, name)
def test_getattr_sdk_method(self): name = 'method' def func(self): pass setattr(func, '_sdkmeta', True) attr = types.MethodType(func, object) assert attr == sdk_utils.getattr_sdk(attr, name)
def test_getattr_sdk_function_negative(self): name = 'function' attr = lambda x: True # noqa: E731 with pytest.raises(AttributeError): sdk_utils.getattr_sdk(attr, name)
def test_getattr_sdk_attribute_negative(self, attr, name): with pytest.raises(AttributeError): sdk_utils.getattr_sdk(attr, name)
def test_getattr_sdk_function(self): name = 'function' attr = lambda x: True # noqa: E731 attr._sdkmeta = True assert attr == sdk_utils.getattr_sdk(attr, name)