Exemple #1
0
 def test_bad_index_type(self):
     assert ListWrapper([], None).dig("a") is None
Exemple #2
0
 def test_single_level(self):
     assert ListWrapper(["a", "b"], None).dig(1) == "b"
Exemple #3
0
 def test_bad_index(self):
     assert ListWrapper([], None).dig(1) is None
Exemple #4
0
 def test_iteration(self):
     assert tuple(ListWrapper(["a", "b"], None)) == ("a", "b")
Exemple #5
0
 def test_getitem_invalid_index_type(self):
     with pytest.raises(TypeError):
         ListWrapper([], None)["a"]
Exemple #6
0
 def test_getitem_invalid_index(self):
     with pytest.raises(IndexError):
         ListWrapper([], None)[1]
Exemple #7
0
 def test_getitem(self):
     assert ListWrapper(["a", "b"], None)[1] == "b"
Exemple #8
0
 def test_empty_visit(self):
     ListWrapper([], None).visit("called", "with", keyword="args")