nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/core/stream: LineIterator use CachedIterator
[nit.git]
/
tests
/
test_neo4j_batch.nit
diff --git
a/tests/test_neo4j_batch.nit
b/tests/test_neo4j_batch.nit
index
e098357
..
499f7ef
100644
(file)
--- a/
tests/test_neo4j_batch.nit
+++ b/
tests/test_neo4j_batch.nit
@@
-14,9
+14,6
@@
import neo4j
import neo4j
-var srv = new Neo4jServer
-srv.start_quiet
-
# key used to loosely assume unicity and prevent conflicting db accesses
var key = "NIT_TESTING_ID".environ.to_i
# key used to loosely assume unicity and prevent conflicting db accesses
var key = "NIT_TESTING_ID".environ.to_i
@@
-37,11
+34,15
@@
kate["status"] = false
var loves = new NeoEdge(andres, "LOVES", kate)
loves["since"] = 1999
var loves = new NeoEdge(andres, "LOVES", kate)
loves["since"] = 1999
-var client = new Neo4jClient("http://localhost:7474")
+var client = new Neo4jClient("http://neo4j:7474")
assert client.is_ok
# Clear the previous objects, if any
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"))
+client.cypher(
+ new CypherQuery.from_string(
+ "MATCH (n) WHERE n.key = \{key\} OPTIONAL MATCH n-[r]-() DELETE r, n"
+ ).set("key", key)
+)
print "# Save batch\n"
print "# Save batch\n"
@@
-60,7
+61,7
@@
var andres_url = andres.url.to_s
var kate_url = kate.url.to_s
var loves_url = loves.url.to_s
var kate_url = kate.url.to_s
var loves_url = loves.url.to_s
-client = new Neo4jClient("http://localhost:7474")
+client = new Neo4jClient("http://neo4j:7474")
assert client.is_ok
# Read Andres
assert client.is_ok
# Read Andres
@@
-96,8
+97,9
@@
print "{res5["name"].to_s} IS LOVED BY {res5.in_nodes("LOVES").first["name"].to_
var query = (new CypherQuery).
nmatch("(n: MALE)-[r: LOVES]->(m)").
nwhere("n.name = 'Andres'").
var query = (new CypherQuery).
nmatch("(n: MALE)-[r: LOVES]->(m)").
nwhere("n.name = 'Andres'").
- nand("n.key = {key}").
- nreturn("n, r, m")
+ nand("n.key = \{key\}").
+ nreturn("n, r, m").
+ set("key", key)
var res7 = client.cypher(query)
assert res7.as(JsonObject)["data"].as(JsonArray).length == 1
var res7 = client.cypher(query)
assert res7.as(JsonObject)["data"].as(JsonArray).length == 1