Пример #1
0
def test_ItemLens_set():
    data = {0: 'hello', 1: 'world'}
    l = b.ItemLens(1)
    assert l.set(data, (2, 'everyone')) == {0: 'hello', 2: 'everyone'}
Пример #2
0
def test_ItemLens_view_nonexistent():
    data = {0: 'hello', 1: 'world'}
    assert b.ItemLens(3).view(data) is None
Пример #3
0
def test_ItemLens_view():
    data = {0: 'hello', 1: 'world'}
    assert b.ItemLens(1).view(data) == (1, 'world')
Пример #4
0
def test_ItemLens_set():
    data = {0: "hello", 1: "world"}
    l = b.ItemLens(1)
    assert l.set(data, (2, "everyone")) == {0: "hello", 2: "everyone"}
Пример #5
0
def test_ItemLens_view_nonexistent():
    data = {0: "hello", 1: "world"}
    assert b.ItemLens(3).view(data) is None
Пример #6
0
def test_ItemLens_view():
    data = {0: "hello", 1: "world"}
    assert b.ItemLens(1).view(data) == (1, "world")