ruff formatting and lint fixes
This commit is contained in:
@@ -81,5 +81,4 @@ INTEGRATION_CREDENTIALS = {
|
||||
credential_id="x",
|
||||
credential_key="access_token",
|
||||
),
|
||||
|
||||
}
|
||||
|
||||
@@ -121,7 +121,6 @@ def register_all_tools(
|
||||
"x_delete_tweet",
|
||||
"x_search_tweets",
|
||||
"x_get_mentions",
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ def register_tools(mcp: FastMCP) -> None:
|
||||
Returns:
|
||||
dict with success status, data, and metadata
|
||||
"""
|
||||
if (offset < 0 or (limit is not None and limit < 0)):
|
||||
if offset < 0 or (limit is not None and limit < 0):
|
||||
return {"error": "offset and limit must be non-negative"}
|
||||
try:
|
||||
secure_path = get_secure_path(path, workspace_id, agent_id, session_id)
|
||||
|
||||
@@ -9,13 +9,9 @@ from aden_tools.tools.x_tool.x_tool import (
|
||||
|
||||
|
||||
class TestXClient(unittest.TestCase):
|
||||
|
||||
@patch("httpx.request")
|
||||
def test_post(self, mock_req):
|
||||
mock_req.return_value = httpx.Response(
|
||||
200,
|
||||
json={"data": {"id": "1", "text": "hi"}}
|
||||
)
|
||||
mock_req.return_value = httpx.Response(200, json={"data": {"id": "1", "text": "hi"}})
|
||||
|
||||
client = _XClient("fake")
|
||||
res = client.request("POST", "/tweets", json={"text": "hi"})
|
||||
|
||||
@@ -22,6 +22,7 @@ if TYPE_CHECKING:
|
||||
|
||||
X_API_BASE = "https://api.twitter.com/2"
|
||||
|
||||
|
||||
# Internal Client
|
||||
class _XClient:
|
||||
"""Internal client wrapping X API v2 calls."""
|
||||
@@ -64,6 +65,7 @@ class _XClient:
|
||||
)
|
||||
return self._handle_response(response)
|
||||
|
||||
|
||||
# Tool Registration
|
||||
def register_tools(
|
||||
mcp: FastMCP,
|
||||
@@ -88,7 +90,6 @@ def register_tools(
|
||||
}
|
||||
return _XClient(token)
|
||||
|
||||
|
||||
# Tools
|
||||
|
||||
@mcp.tool()
|
||||
|
||||
@@ -9,13 +9,9 @@ from aden_tools.tools.x_tool.x_tool import (
|
||||
|
||||
|
||||
class TestXClient(unittest.TestCase):
|
||||
|
||||
@patch("httpx.request")
|
||||
def test_post(self, mock_req):
|
||||
mock_req.return_value = httpx.Response(
|
||||
200,
|
||||
json={"data": {"id": "1", "text": "hi"}}
|
||||
)
|
||||
mock_req.return_value = httpx.Response(200, json={"data": {"id": "1", "text": "hi"}})
|
||||
|
||||
client = _XClient("fake")
|
||||
res = client.request("POST", "/tweets", json={"text": "hi"})
|
||||
|
||||
Reference in New Issue
Block a user