@@ -39,7 +39,7 @@ class FreshDatabaseTestCase(ServerTestCase):
3939
4040 def setUp (self ):
4141 ServerTestCase .setUp (self )
42- session = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token ).session ()
42+ session = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token ).session ()
4343 session .run ("MATCH (n) DETACH DELETE n" )
4444 session .close ()
4545
@@ -48,7 +48,7 @@ class MinimalWorkingExampleTestCase(FreshDatabaseTestCase):
4848
4949 def test_minimal_working_example (self ):
5050 # tag::minimal-example[]
51- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = basic_auth ("neo4j" , "neo4j" ))
51+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = basic_auth ("neo4j" , "neo4j" ))
5252 session = driver .session ()
5353
5454 session .run ("CREATE (a:Person {name:'Arthur', title:'King'})" )
@@ -65,45 +65,45 @@ class ExamplesTestCase(FreshDatabaseTestCase):
6565
6666 def test_construct_driver (self ):
6767 # tag::construct-driver[]
68- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = basic_auth ("neo4j" , "neo4j" ))
68+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = basic_auth ("neo4j" , "neo4j" ))
6969 # end::construct-driver[]
7070 return driver
7171
7272 def test_configuration (self ):
7373 # tag::configuration[]
74- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = basic_auth ("neo4j" , "neo4j" ), max_pool_size = 10 )
74+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = basic_auth ("neo4j" , "neo4j" ), max_pool_size = 10 )
7575 # end::configuration[]
7676 return driver
7777
7878 @skipUnless (SSL_AVAILABLE , "Bolt over TLS is not supported by this version of Python" )
7979 def test_tls_require_encryption (self ):
8080 # tag::tls-require-encryption[]
81- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = basic_auth ("neo4j" , "neo4j" ), encrypted = True )
81+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = basic_auth ("neo4j" , "neo4j" ), encrypted = True )
8282 # end::tls-require-encryption[]
8383
8484 @skipUnless (SSL_AVAILABLE , "Bolt over TLS is not supported by this version of Python" )
8585 def test_tls_trust_on_first_use (self ):
8686 # tag::tls-trust-on-first-use[]
87- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = basic_auth ("neo4j" , "neo4j" ), encrypted = True , trust = TRUST_ON_FIRST_USE )
87+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = basic_auth ("neo4j" , "neo4j" ), encrypted = True , trust = TRUST_ON_FIRST_USE )
8888 # end::tls-trust-on-first-use[]
8989 assert driver
9090
9191 @skip ("testing verified certificates not yet supported " )
9292 def test_tls_signed (self ):
9393 # tag::tls-signed[]
94- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = basic_auth ("neo4j" , "neo4j" ), encrypted = True , trust = TRUST_SIGNED_CERTIFICATES )
94+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = basic_auth ("neo4j" , "neo4j" ), encrypted = True , trust = TRUST_SIGNED_CERTIFICATES )
9595 # end::tls-signed[]
9696 assert driver
9797
9898 @skipUnless (SSL_AVAILABLE , "Bolt over TLS is not supported by this version of Python" )
9999 def test_connect_with_auth_disabled (self ):
100100 # tag::connect-with-auth-disabled[]
101- driver = GraphDatabase .driver ("bolt://myserver :7687" , encrypted = True )
101+ driver = GraphDatabase .driver ("bolt://localhost :7687" , encrypted = True )
102102 # end::connect-with-auth-disabled[]
103103 assert driver
104104
105105 def test_statement (self ):
106- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
106+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
107107 session = driver .session ()
108108 # tag::statement[]
109109 result = session .run ("CREATE (person:Person {name: {name}})" , {"name" : "Arthur" })
@@ -112,7 +112,7 @@ def test_statement(self):
112112 session .close ()
113113
114114 def test_statement_without_parameters (self ):
115- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
115+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
116116 session = driver .session ()
117117 # tag::statement-without-parameters[]
118118 result = session .run ("CREATE (person:Person {name: 'Arthur'})" )
@@ -121,7 +121,7 @@ def test_statement_without_parameters(self):
121121 session .close ()
122122
123123 def test_result_traversal (self ):
124- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
124+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
125125 session = driver .session ()
126126 # tag::result-traversal[]
127127 search_term = "Sword"
@@ -134,7 +134,7 @@ def test_result_traversal(self):
134134 session .close ()
135135
136136 def test_access_record (self ):
137- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
137+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
138138 session = driver .session ()
139139 # tag::access-record[]
140140 search_term = "Arthur"
@@ -147,7 +147,7 @@ def test_access_record(self):
147147 session .close ()
148148
149149 def test_result_retention (self ):
150- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
150+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
151151 # tag::retain-result[]
152152 session = driver .session ()
153153 result = session .run ("MATCH (knight:Person:Knight) WHERE knight.castle = {castle} "
@@ -160,7 +160,7 @@ def test_result_retention(self):
160160 assert isinstance (retained_result , list )
161161
162162 def test_nested_statements (self ):
163- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
163+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
164164 session = driver .session ()
165165 # tag::nested-statements[]
166166 result = session .run ("MATCH (knight:Person:Knight) WHERE knight.castle = {castle} "
@@ -173,7 +173,7 @@ def test_nested_statements(self):
173173 session .close ()
174174
175175 def test_transaction_commit (self ):
176- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
176+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
177177 session = driver .session ()
178178 # tag::transaction-commit[]
179179 with session .begin_transaction () as tx :
@@ -186,7 +186,7 @@ def test_transaction_commit(self):
186186 session .close ()
187187
188188 def test_transaction_rollback (self ):
189- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
189+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
190190 session = driver .session ()
191191 # tag::transaction-rollback[]
192192 with session .begin_transaction () as tx :
@@ -199,7 +199,7 @@ def test_transaction_rollback(self):
199199 session .close ()
200200
201201 def test_result_summary_query_profile (self ):
202- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
202+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
203203 session = driver .session ()
204204 # tag::result-summary-query-profile[]
205205 result = session .run ("PROFILE MATCH (p:Person {name: {name}}) "
@@ -211,7 +211,7 @@ def test_result_summary_query_profile(self):
211211 session .close ()
212212
213213 def test_result_summary_notifications (self ):
214- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
214+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
215215 session = driver .session ()
216216 # tag::result-summary-notifications[]
217217 result = session .run ("EXPLAIN MATCH (king), (queen) RETURN king, queen" )
@@ -222,7 +222,7 @@ def test_result_summary_notifications(self):
222222 session .close ()
223223
224224 def test_handle_cypher_error (self ):
225- driver = GraphDatabase .driver ("bolt://myserver :7687" , auth = auth_token )
225+ driver = GraphDatabase .driver ("bolt://localhost :7687" , auth = auth_token )
226226 session = driver .session ()
227227 with self .assertRaises (RuntimeError ):
228228 # tag::handle-cypher-error[]
0 commit comments