Beispiel #1
0
def test_ItemByValueLens_set_nonexistent():
    data = {'hello': 0, 'world': 1}
    assert b.ItemByValueLens(2).set(data, ('test', 2)) == {
        'hello': 0,
        'world': 1,
        'test': 2
    }
Beispiel #2
0
def test_ItemByValueLens_set_nonexistent():
    data = {"hello": 0, "world": 1}
    assert b.ItemByValueLens(2).set(data, ("test", 2)) == {
        "hello": 0,
        "world": 1,
        "test": 2,
    }
Beispiel #3
0
def test_ItemByValueLens_set():
    data = {'hello': 0, 'world': 1}
    result = {'hello': 0, 'everyone': 2}
    assert b.ItemByValueLens(1).set(data, ('everyone', 2)) == result
Beispiel #4
0
def test_ItemByValueLens_view_nonexistent():
    data = {'hello': 0, 'world': 1}
    assert b.ItemByValueLens(2).view(data) is None
Beispiel #5
0
def test_ItemByValueLens_view():
    data = {'hello': 0, 'world': 1}
    assert b.ItemByValueLens(1).view(data) == ('world', 1)
Beispiel #6
0
def test_ItemByValueLens_set():
    data = {"hello": 0, "world": 1}
    result = {"hello": 0, "everyone": 2}
    assert b.ItemByValueLens(1).set(data, ("everyone", 2)) == result
Beispiel #7
0
def test_ItemByValueLens_view_nonexistent():
    data = {"hello": 0, "world": 1}
    assert b.ItemByValueLens(2).view(data) is None
Beispiel #8
0
def test_ItemByValueLens_view():
    data = {"hello": 0, "world": 1}
    assert b.ItemByValueLens(1).view(data) == ("world", 1)