Skip to content

Commit 779edcc

Browse files
committed
addressing issues found by CodeRabbit
1 parent 58340cf commit 779edcc

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from ._connection import Connection
22
from .authentication_error import AuthenticationError
3+
4+
__all__ = ["Connection", "AuthenticationError"]

src/mccann_hub/odoolib/connector/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,11 @@
22
from .json_rpcs import JsonRpcsConnector
33
from .xml_rpc import XmlRpcConnector
44
from .xml_rpcs import XmlRpcsConnector
5+
6+
__all__ = [
7+
"JsonRpcConnector",
8+
"JsonRpcException",
9+
"JsonRpcsConnector",
10+
"XmlRpcConnector",
11+
"XmlRpcsConnector",
12+
]

src/mccann_hub/odoolib/connector/xml_rpc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ def __init__(
6464
self._transport = transport
6565

6666
def send(self, service_name: str, method: str, *args):
67+
"""
68+
Send a request to the specified service and method with the given arguments.
69+
70+
:param service_name: The name of the service to call (e.g., 'common', 'object', etc.)
71+
:param method: The method name to call on the service
72+
:param args: Additional arguments to pass to the method
73+
:return: The result of the method call
74+
:raises: xmlrpc.client.Fault if the remote call fails
75+
"""
6776
url = "%s/%s" % (self.url, service_name)
6877
service = ServerProxy(url, transport=self._transport)
6978
return getattr(service, method)(*args)

tests/test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ def test_user_context(self):
7070
for protocol in self._get_protocols():
7171
connection = self._conn(protocol)
7272

73-
connection.get_user_context()
73+
context = connection.get_user_context()
74+
self.assertIsInstance(context, dict)
75+
self.assertIn("lang", context)
76+
self.assertIn("tz", context)
7477

7578
def test_search_count(self):
7679
for protocol in self._get_protocols():

tests/test_async.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ async def test_user_context_async(self):
6262
for protocol in self._get_protocols():
6363
connection = self._conn(protocol)
6464

65-
await connection.async_get_user_context()
65+
context = await connection.async_get_user_context()
66+
self.assertIsInstance(context, dict)
67+
self.assertIn("lang", context)
68+
self.assertIn("tz", context)
6669

6770
async def test_search_count_async(self):
6871
"""Tests async search and count."""

0 commit comments

Comments
 (0)