-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathneo4j_test.rb
36 lines (32 loc) · 1.03 KB
/
neo4j_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require "logger"
require_relative "test_helper"
require "neo4j/core/cypher_session/adaptors/http"
require "typhoeus/adapters/faraday"
class Neo4jTest < Minitest::Test
def test_connect
options = {
faraday_configurator: lambda do |faraday|
faraday.adapter :typhoeus
faraday.options[:open_timeout] = 1
end
}
http_adaptor = Neo4j::Core::CypherSession::Adaptors::HTTP.new(connect_url, options)
neo4j_session = Neo4j::Core::CypherSession.new(http_adaptor)
assert_timeout(Faraday::TimeoutError) do
neo4j_session.query("MATCH (n) RETURN n LIMIT 10")
end
end
def test_read
options = {
faraday_configurator: lambda do |faraday|
faraday.adapter :typhoeus
faraday.options[:timeout] = 1
end
}
http_adaptor = Neo4j::Core::CypherSession::Adaptors::HTTP.new(read_url, options)
neo4j_session = Neo4j::Core::CypherSession.new(http_adaptor)
assert_timeout(Faraday::TimeoutError) do
neo4j_session.query("MATCH (n) RETURN n LIMIT 10")
end
end
end