def __init__(self, package, version):
        """Construct a new requirement.

        :param package: the package name.
        :param version: a semver compatible version specification.
        """
        self.package = package
        self.version = version
        if self.version and not re.match(r"[<=>~]", version[:2]):
            self.version = "=={}".format(self.version)
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)