Ejemplo n.º 1
0
def test_mark_append():
    class Obj(object):
        pass

    mark_name = 'some_mark'
    assert try_get_mark(Obj, mark_name) is None
    assert mark(mark_name, 'mark_value', append=True)(Obj) is Obj
    assert get_marks(Obj) == {mark_name: ['mark_value']}
Ejemplo n.º 2
0
def test_mark_append():

    class Obj(object):
        pass

    mark_name = 'some_mark'
    assert try_get_mark(Obj, mark_name) is None
    assert mark(mark_name, 'mark_value', append=True)(Obj) is Obj
    assert get_marks(Obj) == {mark_name: ['mark_value']}
Ejemplo n.º 3
0
def test_mark_immutable(marked_obj, mark_name, mark_value):
    marks = get_marks(marked_obj)
    marks["1"] = ["2"]
    assert get_marks(marked_obj) == {mark_name: mark_value}
Ejemplo n.º 4
0
def test_mark(marked_obj, mark_name, mark_value):
    assert get_marks(marked_obj) == {mark_name: mark_value}
Ejemplo n.º 5
0
def test_mark_immutable(marked_obj, mark_name, mark_value):
    marks = get_marks(marked_obj)
    marks["1"] = ["2"]
    assert get_marks(marked_obj) == {mark_name: mark_value}
Ejemplo n.º 6
0
def test_mark(marked_obj, mark_name, mark_value):
    assert get_marks(marked_obj) == {mark_name: mark_value}