Skip to content

Bringing over .net Testkit changes. #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions tests/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ def __call__(self, *args, **kwargs):

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

try:
response = backend.sendAndReceive(protocol.GetFeatures())
Expand Down
24 changes: 13 additions & 11 deletions tests/stub/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def assert_is_authorization_error(self, error):
elif driver in ['javascript']:
# only test for code
pass
elif driver in ['dotnet']:
self.assertEqual("AuthorizationExpired", error.errorType)
else:
self.fail("no error mapping is defined for %s driver" % driver)

Expand Down Expand Up @@ -223,7 +225,7 @@ def switch_unused_servers(self, servers, new_script):
def test_should_fail_with_auth_expired_on_pull_using_session_run(
self):
# TODO remove this block once all languages work
if get_driver_name() in ['go', 'dotnet']:
if get_driver_name() in ['go']:
self.skipTest("requires authorization expired response support")
driver = Driver(self._backend, self._uri, self._auth,
userAgent=self._userAgent)
Expand All @@ -236,7 +238,7 @@ def test_should_fail_with_auth_expired_on_pull_using_session_run(

session = driver.session('r', database=self.get_db())
try:
session.run("RETURN 1 as n").consume()
session.run("RETURN 1 as n")
except types.DriverError as e:
self.assert_is_authorization_error(error=e)
session.close()
Expand All @@ -247,7 +249,7 @@ def test_should_fail_with_auth_expired_on_pull_using_session_run(

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

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

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

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

def test_should_fail_with_auth_expired_on_rollback_using_tx_run(self):
# TODO remove this block once all languages work
if get_driver_name() in ['go', 'dotnet']:
if get_driver_name() in ['go']:
self.skipTest("requires authorization expired response support")
driver = Driver(self._backend, self._uri, self._auth,
userAgent=self._userAgent)
Expand All @@ -377,7 +379,7 @@ def test_should_fail_with_auth_expired_on_rollback_using_tx_run(self):
def test_should_retry_on_auth_expired_on_begin_using_tx_function(
self):
# TODO remove this block once all languages work
if get_driver_name() in ['go','dotnet']:
if get_driver_name() in ['go']:
self.skipTest("requires authorization expired response support")
driver = Driver(self._backend, self._uri, self._auth,
userAgent=self._userAgent)
Expand Down Expand Up @@ -419,7 +421,7 @@ def work(tx):
def test_should_retry_on_auth_expired_on_run_using_tx_function(
self):
# TODO remove this block once all languages work
if get_driver_name() in ['go', 'dotnet']:
if get_driver_name() in ['go']:
self.skipTest("requires authorization expired response support")
driver = Driver(self._backend, self._uri, self._auth,
userAgent=self._userAgent)
Expand Down Expand Up @@ -461,7 +463,7 @@ def work(tx):
def test_should_retry_on_auth_expired_on_pull_using_tx_function(
self):
# TODO remove this block once all languages work
if get_driver_name() in ['go', 'dotnet']:
if get_driver_name() in ['go']:
self.skipTest("requires authorization expired response support")
driver = Driver(self._backend, self._uri, self._auth,
userAgent=self._userAgent)
Expand Down Expand Up @@ -503,7 +505,7 @@ def work(tx):
def test_should_retry_on_auth_expired_on_commit_using_tx_function(
self):
# TODO remove this block once all languages work
if get_driver_name() in ['go', 'dotnet']:
if get_driver_name() in ['go']:
self.skipTest("requires authorization expired response support")
driver = Driver(self._backend, self._uri, self._auth,
userAgent=self._userAgent)
Expand Down
9 changes: 2 additions & 7 deletions tests/stub/routing/test_routing_v4x3.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ def test_should_use_read_session_mode_and_initial_bookmark_when_reading_using_tx
self.assertEqual(["NewBookmark"], last_bookmarks)

def test_should_pass_bookmark_from_tx_to_tx_using_tx_run(self):
# TODO remove this block once all languages work
driver = Driver(self._backend, self._uri_with_context, self._auth,
self._userAgent)
self.start_server(self._routingServer1, "router_adb.script")
Expand Down Expand Up @@ -1543,9 +1542,6 @@ def test_should_pass_system_bookmark_when_getting_rt_for_multi_db(self):
pass

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

def test_should_successfully_acquire_rt_when_router_ip_changes(self):
# TODO remove this block once all languages work
if get_driver_name() in ['dotnet']:
self.skipTest("needs ROUTE bookmark list support")
if get_driver_name() in ['dotnet', 'go']:

if get_driver_name() in ['go']:
self.skipTest("needs verifyConnectivity support")
ip_addresses = []
if platform == "linux":
Expand Down