Repository: codenotary/immudb-py (language: python)

Issue:
grpc.RpcError exception
`grpc._channel._InactiveRpcError` in tests should be replaced with `grpc.RpcError`.

Reference:
-  [grpc/examples/python/errors](https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L33)
-  article about [grpc errors](https://avi.im/grpc-errors/#python)

grpc.RpcError exception
`grpc._channel._InactiveRpcError` in tests should be replaced with `grpc.RpcError`.

Reference:
-  [grpc/examples/python/errors](https://github.com/grpc/grpc/blob/master/examples/python/errors/client.py#L33)
-  article about [grpc errors](https://avi.im/grpc-errors/#python)



Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index b071ac2..a6fc17c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ lib/
 .project
 .pydevproject
 .idea
+venv


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
index b34f5ce..09ad42d 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -23,7 +23,7 @@ def client_margs(*args, **kwargs):
         else:
             client = ImmudbClient(*args, **kwargs)
             client.login("immudb", "immudb")
-    except grpc._channel._InactiveRpcError as e:
+    except grpc.RpcError as e:
         pytest.skip("Cannot reach immudb server")
         return
     return client
diff --git a/tests/immu/test_basic.py b/tests/immu/test_basic.py
index bf86c5d..0c77215 100644
--- a/tests/immu/test_basic.py
+++ b/tests/immu/test_basic.py
@@ -21,7 +21,7 @@ def test_no_server(self):
         try:
             a = ImmudbClient("localhost:9999")
             a.login("immudb", "immudb")
-        except grpc._channel._InactiveRpcError:
+        except grpc.RpcError:
             pass
 
     def test_basic(self, client):
diff --git a/tests/immu/test_execAll.py b/tests/immu/test_execAll.py
index 35cdc03..c595688 100644
--- a/tests/immu/test_execAll.py
+++ b/tests/immu/test_execAll.py
@@ -68,7 +68,7 @@ def test_execAll_zadd(self):
         try:
             a = ImmudbClient("localhost:3322")
             a.login("immudb", "immudb")
-        except grpc._channel._InactiveRpcError as e:
+        except grpc.RpcError as e:
             pytest.skip("Cannot reach immudb server")
         kvsend = []
         zaddsend = []
diff --git a/tests/immu/test_statefile.py b/tests/immu/test_statefile.py
index 51cd3ab..72dfa18 100644
--- a/tests/immu/test_statefile.py
+++ b/tests/immu/test_statefile.py
@@ -31,7 +31,7 @@ def test_basic(rootfile):
     try:
         a = ImmudbClient(rs=PersistentRootService(rootfile))
         a.login("immudb", "immudb")
-    except grpc._channel._InactiveRpcError as e:
+    except grpc.RpcError as e:
         pytest.skip("Cannot reach immudb server")
     key = "test_key_{:04d}".format(randint(0, 10000))
     value = "test_value_{:04d}".format(randint(0, 10000))
diff --git a/tests/immu/test_user_operations.py b/tests/immu/test_user_operations.py
index 528afe8..31a80fc 100644
--- a/tests/immu/test_user_operations.py
+++ b/tests/immu/test_user_operations.py
@@ -32,7 +32,7 @@ def test_users_functions(self, client):
         try:
             resp = client.createUser(user, password, permission, database)
             assert False  # it is not allowed to create a user twice
-        except grpc._channel._InactiveRpcError as e:
+        except grpc.RpcError as e:
             assert e.details() == 'user already exists'
 
         user1 = "test_"+get_random_name(8)
@@ -43,13 +43,13 @@ def test_users_functions(self, client):
         try:
             resp = client.createUser(user1, "12345", permission, database)
             assert False  # it is not allowed to create a trivial password
-        except grpc._channel._InactiveRpcError as e:
+        except grpc.RpcError as e:
             pass
 
         try:
             resp = client.createUser(user1, "12345", permission, database)
             assert False  # it is not allowed to create a trivial password
-        except grpc._channel._InactiveRpcError as e:
+        except grpc.RpcError as e:
             pass
 
         newPassword = "Pw1:"+get_random_string(12)