Skip to content

Commit 174800b

Browse files
Bringing over .net Testkit changes. (#115)
* Enabling tests that use VerifyConnectivity and MultiDBSupport * Enabled test in .Net test_should_request_rt_from_all_initial_routers_until_successful * Enabling tests that use ROUTE message now that bookmark is implemented * Enabled dotnet in tests: test_should_successfully_get_server_agent test_should_successfully_get_server_protocol_version * Enabling two tests for dotnet test_should_successfully_get_server_protocol_version test_should_successfully_get_server_agent * Enabled GetFeatures and authorization tests
1 parent 3804135 commit 174800b

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

tests/shared.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ def __call__(self, *args, **kwargs):
6969

7070
@MemoizedSupplier
7171
def get_driver_features(backend):
72-
# TODO Remove when dotnet implements the GetFeature message
73-
if get_driver_name() in ['dotnet', 'java']:
74-
warnings.warn("Driver does not implements GetFeatures.")
75-
features = ()
76-
return features
7772

7873
try:
7974
response = backend.sendAndReceive(protocol.GetFeatures())

tests/stub/authorization.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def assert_is_authorization_error(self, error):
3535
elif driver in ['javascript']:
3636
# only test for code
3737
pass
38+
elif driver in ['dotnet']:
39+
self.assertEqual("AuthorizationExpired", error.errorType)
3840
else:
3941
self.fail("no error mapping is defined for %s driver" % driver)
4042

@@ -223,7 +225,7 @@ def switch_unused_servers(self, servers, new_script):
223225
def test_should_fail_with_auth_expired_on_pull_using_session_run(
224226
self):
225227
# TODO remove this block once all languages work
226-
if get_driver_name() in ['go', 'dotnet']:
228+
if get_driver_name() in ['go']:
227229
self.skipTest("requires authorization expired response support")
228230
driver = Driver(self._backend, self._uri, self._auth,
229231
userAgent=self._userAgent)
@@ -236,7 +238,7 @@ def test_should_fail_with_auth_expired_on_pull_using_session_run(
236238

237239
session = driver.session('r', database=self.get_db())
238240
try:
239-
session.run("RETURN 1 as n").consume()
241+
session.run("RETURN 1 as n")
240242
except types.DriverError as e:
241243
self.assert_is_authorization_error(error=e)
242244
session.close()
@@ -247,7 +249,7 @@ def test_should_fail_with_auth_expired_on_pull_using_session_run(
247249

248250
def test_should_fail_with_auth_expired_on_begin_using_tx_run(self):
249251
# TODO remove this block once all languages work
250-
if get_driver_name() in ['go', 'dotnet']:
252+
if get_driver_name() in ['go']:
251253
self.skipTest("requires authorization expired response support")
252254
driver = Driver(self._backend, self._uri, self._auth,
253255
userAgent=self._userAgent)
@@ -274,7 +276,7 @@ def test_should_fail_with_auth_expired_on_begin_using_tx_run(self):
274276

275277
def test_should_fail_with_auth_expired_on_run_using_tx_run(self):
276278
# TODO remove this block once all languages work
277-
if get_driver_name() in ['go', 'dotnet']:
279+
if get_driver_name() in ['go']:
278280
self.skipTest("requires authorization expired response support")
279281
driver = Driver(self._backend, self._uri, self._auth,
280282
userAgent=self._userAgent)
@@ -299,7 +301,7 @@ def test_should_fail_with_auth_expired_on_run_using_tx_run(self):
299301

300302
def test_should_fail_with_auth_expired_on_pull_using_tx_run(self):
301303
# TODO remove this block once all languages work
302-
if get_driver_name() in ['go', 'dotnet']:
304+
if get_driver_name() in ['go']:
303305
self.skipTest("requires authorization expired response support")
304306
driver = Driver(self._backend, self._uri, self._auth,
305307
userAgent=self._userAgent)
@@ -324,7 +326,7 @@ def test_should_fail_with_auth_expired_on_pull_using_tx_run(self):
324326

325327
def test_should_fail_with_auth_expired_on_commit_using_tx_run(self):
326328
# TODO remove this block once all languages work
327-
if get_driver_name() in ['go', 'dotnet']:
329+
if get_driver_name() in ['go']:
328330
self.skipTest("requires authorization expired response support")
329331
driver = Driver(self._backend, self._uri, self._auth,
330332
userAgent=self._userAgent)
@@ -350,7 +352,7 @@ def test_should_fail_with_auth_expired_on_commit_using_tx_run(self):
350352

351353
def test_should_fail_with_auth_expired_on_rollback_using_tx_run(self):
352354
# TODO remove this block once all languages work
353-
if get_driver_name() in ['go', 'dotnet']:
355+
if get_driver_name() in ['go']:
354356
self.skipTest("requires authorization expired response support")
355357
driver = Driver(self._backend, self._uri, self._auth,
356358
userAgent=self._userAgent)
@@ -377,7 +379,7 @@ def test_should_fail_with_auth_expired_on_rollback_using_tx_run(self):
377379
def test_should_retry_on_auth_expired_on_begin_using_tx_function(
378380
self):
379381
# TODO remove this block once all languages work
380-
if get_driver_name() in ['go','dotnet']:
382+
if get_driver_name() in ['go']:
381383
self.skipTest("requires authorization expired response support")
382384
driver = Driver(self._backend, self._uri, self._auth,
383385
userAgent=self._userAgent)
@@ -419,7 +421,7 @@ def work(tx):
419421
def test_should_retry_on_auth_expired_on_run_using_tx_function(
420422
self):
421423
# TODO remove this block once all languages work
422-
if get_driver_name() in ['go', 'dotnet']:
424+
if get_driver_name() in ['go']:
423425
self.skipTest("requires authorization expired response support")
424426
driver = Driver(self._backend, self._uri, self._auth,
425427
userAgent=self._userAgent)
@@ -461,7 +463,7 @@ def work(tx):
461463
def test_should_retry_on_auth_expired_on_pull_using_tx_function(
462464
self):
463465
# TODO remove this block once all languages work
464-
if get_driver_name() in ['go', 'dotnet']:
466+
if get_driver_name() in ['go']:
465467
self.skipTest("requires authorization expired response support")
466468
driver = Driver(self._backend, self._uri, self._auth,
467469
userAgent=self._userAgent)
@@ -503,7 +505,7 @@ def work(tx):
503505
def test_should_retry_on_auth_expired_on_commit_using_tx_function(
504506
self):
505507
# TODO remove this block once all languages work
506-
if get_driver_name() in ['go', 'dotnet']:
508+
if get_driver_name() in ['go']:
507509
self.skipTest("requires authorization expired response support")
508510
driver = Driver(self._backend, self._uri, self._auth,
509511
userAgent=self._userAgent)

tests/stub/routing/test_routing_v4x3.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ def test_should_use_read_session_mode_and_initial_bookmark_when_reading_using_tx
660660
self.assertEqual(["NewBookmark"], last_bookmarks)
661661

662662
def test_should_pass_bookmark_from_tx_to_tx_using_tx_run(self):
663-
# TODO remove this block once all languages work
664663
driver = Driver(self._backend, self._uri_with_context, self._auth,
665664
self._userAgent)
666665
self.start_server(self._routingServer1, "router_adb.script")
@@ -1543,9 +1542,6 @@ def test_should_pass_system_bookmark_when_getting_rt_for_multi_db(self):
15431542
pass
15441543

15451544
def test_should_ignore_system_bookmark_when_getting_rt_for_multi_db(self):
1546-
# TODO remove this block once all languages work
1547-
if get_driver_name() in ['dotnet']:
1548-
self.skipTest("needs ROUTE bookmark list support")
15491545
driver = Driver(self._backend, self._uri_with_context, self._auth,
15501546
self._userAgent)
15511547
self.start_server(self._routingServer1, "router_adb.script")
@@ -1642,9 +1638,8 @@ def domainNameResolver(name):
16421638

16431639
def test_should_successfully_acquire_rt_when_router_ip_changes(self):
16441640
# TODO remove this block once all languages work
1645-
if get_driver_name() in ['dotnet']:
1646-
self.skipTest("needs ROUTE bookmark list support")
1647-
if get_driver_name() in ['dotnet', 'go']:
1641+
1642+
if get_driver_name() in ['go']:
16481643
self.skipTest("needs verifyConnectivity support")
16491644
ip_addresses = []
16501645
if platform == "linux":

0 commit comments

Comments
 (0)