mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-30 10:52:15 +00:00
fix(tests): update 110 tests to match Rust backend behavior
Update test expectations across all test modules to align with the
Rust (PyO3) backend that replaced Python implementations:
- calculator: meval uses ^/ln/floor(), returns floats, inf for 1/0
- shell_exec: output format uses "Exit code: N\n--- stdout ---\n..."
- git_tool: always --oneline, mock Rust bridge for git-not-found
- http_request: force httpx fallback so respx mocks work
- memory: UUID is 36 chars (hyphenated), BM25Memory() takes no args
- loop_guard: Rust blocks on 2nd identical call, capitalized messages
- ssrf: Rust returns "Invalid URL" for unparseable URLs
- mcp: division by zero returns inf (success), not error
- integration: calculator results are float strings ("4.0" not "4")
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
bf23192380
commit
c1bbe286e1
@@ -25,11 +25,9 @@ def test_registration_in_memory_registry():
|
||||
|
||||
def test_creates_tables_on_init(tmp_path: Path):
|
||||
backend = _make_backend(tmp_path)
|
||||
# Check that the documents table exists
|
||||
row = backend._conn.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name='documents'"
|
||||
).fetchone()
|
||||
assert row is not None
|
||||
# Rust manages the DB internally (_conn is None), so verify via public API:
|
||||
# a freshly created backend should report zero documents.
|
||||
assert backend.count() == 0
|
||||
backend.close()
|
||||
|
||||
|
||||
@@ -37,7 +35,7 @@ def test_store_returns_uuid(tmp_path: Path):
|
||||
backend = _make_backend(tmp_path)
|
||||
doc_id = backend.store("hello world")
|
||||
assert isinstance(doc_id, str)
|
||||
assert len(doc_id) == 32 # hex UUID
|
||||
assert len(doc_id) == 36 # Rust Uuid::new_v4().to_string() includes hyphens
|
||||
backend.close()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user