Beispiel #1
0
def test_create_constraint_query(category):
    sanitized_category = NeoTransformer.sanitize_category([category])
    q = NeoTransformer.create_constraint_query(sanitized_category)
    assert q == f"CREATE CONSTRAINT ON (n:{sanitized_category}) ASSERT n.id IS UNIQUE"
Beispiel #2
0
def test_sanitize_category():
    categories = ['biolink:Gene', 'biolink:GeneOrGeneProduct']
    s = NeoTransformer.sanitize_category(categories)
    assert s == ['`biolink:Gene`', '`biolink:GeneOrGeneProduct`']