Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 22:15 UTC
style: ruff format SEC-316 tests
Apply `ruff format --config config/ruff.toml` to fix `with patch(...)` multi-line indentation that the CI Lint and Format Check rejected. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Srujan A <srujan@composio.dev>
Zen Agent committed
May 6, 2026 at 06:20 UTC
6e526c4ec65ad0c749db41ecae4d7b1bd66f4e81
1 file changed
+16
-8
python/tests/test_files.py
+16
-8
@@ -2012,8 +2012,10 @@ class TestFileDownloadablePathTraversal:
2012
mimetype="application/octet-stream",
2013
s3url="https://example.com/file",
2014
)
2015
- with patch("composio.core.models._files.requests.get",
2016
- return_value=self._mock_response(b"#!/bin/sh\n")):
2015
+ with patch(
2016
+ "composio.core.models._files.requests.get",
2017
+ return_value=self._mock_response(b"#!/bin/sh\n"),
2018
+ ):
2019
written = f.download(outdir)
2020
2021
# Traversal sequence collapsed to basename and stayed inside outdir.
@@ -2029,8 +2031,10 @@ class TestFileDownloadablePathTraversal:
2031
mimetype="application/octet-stream",
2032
s3url="https://example.com/file",
2033
)
2032
- with patch("composio.core.models._files.requests.get",
2033
- return_value=self._mock_response(b"x")):
2034
+ with patch(
2035
+ "composio.core.models._files.requests.get",
2036
+ return_value=self._mock_response(b"x"),
2037
+ ):
2038
written = f.download(outdir)
2039
2040
# `Path('/etc/passwd').name == 'passwd'` — absolute path is stripped.
@@ -2048,8 +2052,10 @@ class TestFileDownloadablePathTraversal:
2052
mimetype="application/octet-stream",
2053
s3url="https://example.com/file",
2054
)
2051
- with patch("composio.core.models._files.requests.get",
2052
- return_value=self._mock_response()):
2055
+ with patch(
2056
+ "composio.core.models._files.requests.get",
2057
+ return_value=self._mock_response(),
2058
+ ):
2059
with pytest.raises(ErrorDownloadingFile, match="Path traversal detected"):
2060
f.download(outdir)
2061
# No file was written under the parent.
@@ -2062,8 +2068,10 @@ class TestFileDownloadablePathTraversal:
2068
mimetype="application/pdf",
2069
s3url="https://example.com/file",
2070
)
2065
- with patch("composio.core.models._files.requests.get",
2066
- return_value=self._mock_response(b"%PDF-1.4")):
2071
+ with patch(
2072
+ "composio.core.models._files.requests.get",
2073
+ return_value=self._mock_response(b"%PDF-1.4"),
2074
+ ):
2075
written = f.download(outdir)
2076
2077
assert written == outdir / "report.pdf"