@@ -45,7 +45,7 @@ class FreshDatabaseTestCase(ServerTestCase):
45
45
46
46
def setUp (self ):
47
47
ServerTestCase .setUp (self )
48
- session = GraphDatabase .driver ("bolt://localhost" , auth = auth_token ).session ()
48
+ session = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token ).session ()
49
49
session .run ("MATCH (n) DETACH DELETE n" )
50
50
session .close ()
51
51
@@ -54,7 +54,7 @@ class MinimalWorkingExampleTestCase(FreshDatabaseTestCase):
54
54
55
55
def test_minimal_working_example (self ):
56
56
# tag::minimal-example[]
57
- driver = GraphDatabase .driver ("bolt://localhost" , auth = basic_auth ("neotest" , "neotest" ))
57
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = basic_auth ("neotest" , "neotest" ))
58
58
session = driver .session ()
59
59
60
60
session .run ("CREATE (a:Person {name:'Arthur', title:'King'})" )
@@ -71,45 +71,45 @@ class ExamplesTestCase(FreshDatabaseTestCase):
71
71
72
72
def test_construct_driver (self ):
73
73
# tag::construct-driver[]
74
- driver = GraphDatabase .driver ("bolt://localhost" , auth = basic_auth ("neotest" , "neotest" ))
74
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = basic_auth ("neotest" , "neotest" ))
75
75
# end::construct-driver[]
76
76
return driver
77
77
78
78
def test_configuration (self ):
79
79
# tag::configuration[]
80
- driver = GraphDatabase .driver ("bolt://localhost" , auth = basic_auth ("neotest" , "neotest" ), max_pool_size = 10 )
80
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = basic_auth ("neotest" , "neotest" ), max_pool_size = 10 )
81
81
# end::configuration[]
82
82
return driver
83
83
84
84
@skipUnless (SSL_AVAILABLE , "Bolt over TLS is not supported by this version of Python" )
85
85
def test_tls_require_encryption (self ):
86
86
# tag::tls-require-encryption[]
87
- driver = GraphDatabase .driver ("bolt://localhost" , auth = basic_auth ("neotest" , "neotest" ), encrypted = True )
87
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = basic_auth ("neotest" , "neotest" ), encrypted = True )
88
88
# end::tls-require-encryption[]
89
89
90
90
@skipUnless (SSL_AVAILABLE , "Bolt over TLS is not supported by this version of Python" )
91
91
def test_tls_trust_on_first_use (self ):
92
92
# tag::tls-trust-on-first-use[]
93
- driver = GraphDatabase .driver ("bolt://localhost" , auth = basic_auth ("neotest" , "neotest" ), encrypted = True , trust = TRUST_ON_FIRST_USE )
93
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = basic_auth ("neotest" , "neotest" ), encrypted = True , trust = TRUST_ON_FIRST_USE )
94
94
# end::tls-trust-on-first-use[]
95
95
assert driver
96
96
97
97
@skip ("testing verified certificates not yet supported " )
98
98
def test_tls_signed (self ):
99
99
# tag::tls-signed[]
100
- driver = GraphDatabase .driver ("bolt://localhost" , auth = basic_auth ("neotest" , "neotest" ), encrypted = True , trust = TRUST_SIGNED_CERTIFICATES )
100
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = basic_auth ("neotest" , "neotest" ), encrypted = True , trust = TRUST_SIGNED_CERTIFICATES )
101
101
# end::tls-signed[]
102
102
assert driver
103
103
104
104
@skipUnless (SSL_AVAILABLE , "Bolt over TLS is not supported by this version of Python" )
105
105
def test_connect_with_auth_disabled (self ):
106
106
# tag::connect-with-auth-disabled[]
107
- driver = GraphDatabase .driver ("bolt://localhost" , encrypted = True )
107
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , encrypted = True )
108
108
# end::connect-with-auth-disabled[]
109
109
assert driver
110
110
111
111
def test_statement (self ):
112
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
112
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
113
113
session = driver .session ()
114
114
# tag::statement[]
115
115
result = session .run ("CREATE (person:Person {name: {name}})" , {"name" : "Arthur" })
@@ -118,7 +118,7 @@ def test_statement(self):
118
118
session .close ()
119
119
120
120
def test_statement_without_parameters (self ):
121
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
121
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
122
122
session = driver .session ()
123
123
# tag::statement-without-parameters[]
124
124
result = session .run ("CREATE (person:Person {name: 'Arthur'})" )
@@ -127,7 +127,7 @@ def test_statement_without_parameters(self):
127
127
session .close ()
128
128
129
129
def test_result_traversal (self ):
130
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
130
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
131
131
session = driver .session ()
132
132
# tag::result-traversal[]
133
133
search_term = "Sword"
@@ -140,7 +140,7 @@ def test_result_traversal(self):
140
140
session .close ()
141
141
142
142
def test_access_record (self ):
143
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
143
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
144
144
session = driver .session ()
145
145
# tag::access-record[]
146
146
search_term = "Arthur"
@@ -153,7 +153,7 @@ def test_access_record(self):
153
153
session .close ()
154
154
155
155
def test_result_retention (self ):
156
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
156
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
157
157
# tag::retain-result[]
158
158
session = driver .session ()
159
159
result = session .run ("MATCH (knight:Person:Knight) WHERE knight.castle = {castle} "
@@ -166,7 +166,7 @@ def test_result_retention(self):
166
166
assert isinstance (retained_result , list )
167
167
168
168
def test_nested_statements (self ):
169
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
169
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
170
170
session = driver .session ()
171
171
# tag::nested-statements[]
172
172
result = session .run ("MATCH (knight:Person:Knight) WHERE knight.castle = {castle} "
@@ -179,7 +179,7 @@ def test_nested_statements(self):
179
179
session .close ()
180
180
181
181
def test_transaction_commit (self ):
182
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
182
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
183
183
session = driver .session ()
184
184
# tag::transaction-commit[]
185
185
with session .begin_transaction () as tx :
@@ -192,7 +192,7 @@ def test_transaction_commit(self):
192
192
session .close ()
193
193
194
194
def test_transaction_rollback (self ):
195
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
195
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
196
196
session = driver .session ()
197
197
# tag::transaction-rollback[]
198
198
with session .begin_transaction () as tx :
@@ -205,7 +205,7 @@ def test_transaction_rollback(self):
205
205
session .close ()
206
206
207
207
def test_result_summary_query_profile (self ):
208
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
208
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
209
209
session = driver .session ()
210
210
# tag::result-summary-query-profile[]
211
211
result = session .run ("PROFILE MATCH (p:Person {name: {name}}) "
@@ -217,7 +217,7 @@ def test_result_summary_query_profile(self):
217
217
session .close ()
218
218
219
219
def test_result_summary_notifications (self ):
220
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
220
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
221
221
session = driver .session ()
222
222
# tag::result-summary-notifications[]
223
223
result = session .run ("EXPLAIN MATCH (king), (queen) RETURN king, queen" )
@@ -228,7 +228,7 @@ def test_result_summary_notifications(self):
228
228
session .close ()
229
229
230
230
def test_handle_cypher_error (self ):
231
- driver = GraphDatabase .driver ("bolt://localhost" , auth = auth_token )
231
+ driver = GraphDatabase .driver ("bolt://localhost:7687 " , auth = auth_token )
232
232
session = driver .session ()
233
233
with self .assertRaises (RuntimeError ):
234
234
# tag::handle-cypher-error[]
0 commit comments