def test_add_already_added(self):
        prio_set_list = event._PrioritizedSetList()
        obj = object()
        prio_set_list.add(0, obj)

        with pytest.raises(ValueError) as excinfo:
            prio_set_list.add(0, obj)
        excinfo.match(r"has already been added")

        with pytest.raises(ValueError) as excinfo:
            prio_set_list.add(1, obj)
        excinfo.match(r"has already been added")
def test_can_encode_relationship_with_properties(self):
        a = Node("Person", name="Alice")
        b = Node("Person", name="Bob")
        ab = KNOWS(a, b, since=1999)
        encoded = cypher_repr(ab, related_node_template="{property.name}")
        self.assertEqual("(Alice)-[:KNOWS {since: 1999}]->(Bob)", encoded)