def test_bad_index_type(self): assert ListWrapper([], None).dig("a") is None
def test_single_level(self): assert ListWrapper(["a", "b"], None).dig(1) == "b"
def test_bad_index(self): assert ListWrapper([], None).dig(1) is None
def test_iteration(self): assert tuple(ListWrapper(["a", "b"], None)) == ("a", "b")
def test_getitem_invalid_index_type(self): with pytest.raises(TypeError): ListWrapper([], None)["a"]
def test_getitem_invalid_index(self): with pytest.raises(IndexError): ListWrapper([], None)[1]
def test_getitem(self): assert ListWrapper(["a", "b"], None)[1] == "b"
def test_empty_visit(self): ListWrapper([], None).visit("called", "with", keyword="args")