def test_ItemLens_set(): data = {0: 'hello', 1: 'world'} l = b.ItemLens(1) assert l.set(data, (2, 'everyone')) == {0: 'hello', 2: 'everyone'}
def test_ItemLens_view_nonexistent(): data = {0: 'hello', 1: 'world'} assert b.ItemLens(3).view(data) is None
def test_ItemLens_view(): data = {0: 'hello', 1: 'world'} assert b.ItemLens(1).view(data) == (1, 'world')
def test_ItemLens_set(): data = {0: "hello", 1: "world"} l = b.ItemLens(1) assert l.set(data, (2, "everyone")) == {0: "hello", 2: "everyone"}
def test_ItemLens_view_nonexistent(): data = {0: "hello", 1: "world"} assert b.ItemLens(3).view(data) is None
def test_ItemLens_view(): data = {0: "hello", 1: "world"} assert b.ItemLens(1).view(data) == (1, "world")