def test_tuple_access(): pt = PathTuple([1, 2, 3]) assert 1 in pt assert 3 in pt assert pt == (1, 2, 3) assert pt[0] == 1 assert pt[2] == 3 assert pt.count(1) == 1 assert pt[:2] == (1, 2) assert pt[1:] == (2, 3) assert pt[:] == (1, 2, 3) assert pt[1:2] == (2, ) assert pt[::2] == (1, 3) assert pt[-1] == 3 assert pt[-2:] == (2, 3)
def test_initialized_empty(): pt = PathTuple() assert len(pt) == 0 assert pt == () assert "a" not in pt assert pt.count("") == 0 with pytest.raises(ValueError): pt.index(None) with pytest.raises(IndexError): _ = pt[1] for x in pt: assert False