def test_pop_too_many(self): yp = YAMLPath("abc.def") with pytest.raises(YAMLPathException) as ex: for _ in range(5): yp.pop() assert -1 < str(ex.value).find("Cannot pop when")
def test_pop_segments(self, path, pops, results): yp = YAMLPath(path) for pop in range(pops): assert results[pop] == yp.pop()