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, 03:37 UTC
| 1 | """Behavioral tests for the real-home write guard.""" |
| 2 | |
| 3 | from types import SimpleNamespace |
| 4 | |
| 5 | import pytest |
| 6 | |
| 7 | from tests.conftest import guard_real_home_directory |
| 8 | |
| 9 | |
| 10 | def test_real_home_guard_reports_without_deleting_new_directory(tmp_path): |
| 11 | baseline = {"path": tmp_path, "entries": set()} |
| 12 | request = SimpleNamespace(node=SimpleNamespace(nodeid="test_external_write")) |
| 13 | guard = guard_real_home_directory.__wrapped__(request, baseline) |
| 14 | |
| 15 | next(guard) |
| 16 | unrelated = tmp_path / "unrelated-empty-directory" |
| 17 | unrelated.mkdir() |
| 18 | |
| 19 | with pytest.raises(pytest.fail.Exception, match="created"): |
| 20 | next(guard) |
| 21 | |
| 22 | assert unrelated.is_dir() |