action_nitro: update to use gamnit animations
[nit.git] / tests / test_neo4j.nit
index e556349..5da93bb 100644 (file)
@@ -14,6 +14,7 @@
 
 import neo4j
 
+# key used to loosely assume unicity and prevent conflicting db accesses
 var key = "NIT_TESTING_ID".environ.to_i
 
 var srv = new Neo4jServer
@@ -24,6 +25,9 @@ print "# Test local\n"
 var client = new Neo4jClient("http://localhost:7474")
 assert client.is_ok
 
+# Clear the previous objects, if any
+client.cypher(new CypherQuery.from_string("MATCH (n) WHERE n.key = {key} OPTIONAL MATCH n-[r]-() DELETE r, n"))
+
 var andres = new NeoNode
 andres.labels.add_all(["PERSON", "MALE"])
 andres["name"] = "Andres"
@@ -122,5 +126,5 @@ var query = (new CypherQuery).
        nand("n.key = {key}").
        nreturn("n, r, m")
 var res7 = client.cypher(query)
-assert not res7.as(JsonObject)["data"].as(JsonArray).is_empty
+assert res7.as(JsonObject)["data"].as(JsonArray).length == 1