예제 #1
0
def test__get__with_inst():
    def wrapped(inst):
        return 'a'
    decorator = reify(wrapped)
    inst = Dummy()
    result = decorator.__get__(inst)
    assert result == 'a'
    assert inst.__dict__['wrapped'] == 'a'
예제 #2
0
def test__get__with_inst():
    def wrapped(inst):
        return 'a'
    decorator = reify(wrapped)
    inst = Dummy()
    result = decorator.__get__(inst)
    assert result == 'a'
    assert inst.__dict__['wrapped'] == 'a'
예제 #3
0
def test__get__with_inst():
    def wrapped(inst):
        return "a"

    decorator = reify(wrapped)
    inst = Dummy()
    result = decorator.__get__(inst)
    assert result == "a"
    assert inst.__dict__["wrapped"] == "a"
예제 #4
0
def test_no_doc():
    def wrapped(inst):
        pass

    decorator = reify(wrapped)
    assert decorator.__doc__ is None
예제 #5
0
def test__doc__copied():
    def wrapped(inst):
        """My doc"""

    decorator = reify(wrapped)
    assert decorator.__doc__ == "My doc"
예제 #6
0
def test__get__noinst():
    decorator = reify(None)
    result = decorator.__get__(None)
    assert result is decorator
예제 #7
0
def test__doc__copied():
    def wrapped(inst):
        """My doc"""

    decorator = reify(wrapped)
    assert decorator.__doc__ == 'My doc'
예제 #8
0
def test__get__noinst():
    decorator = reify(None)
    result = decorator.__get__(None)
    assert result is decorator
예제 #9
0
def test_no_doc():
    def wrapped(inst):
        pass

    decorator = reify(wrapped)
    assert decorator.__doc__ is None