Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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)
Example #5
0
 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)
Example #6
0
 def test_getattr_sdk_attribute_negative(self, attr, name):
     with pytest.raises(AttributeError):
         sdk_utils.getattr_sdk(attr, name)
Example #7
0
 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)
Example #8
0
 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)
Example #9
0
 def test_getattr_sdk_attribute_negative(self, attr, name):
     with pytest.raises(AttributeError):
         sdk_utils.getattr_sdk(attr, name)
Example #10
0
 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)