feat(refactor): Document refactoring progress and phases in markdown

feat(scripts): Add backfill script for content_hash in cache tables

feat(scripts): Create recompute script for analysis_cache population

test(tests): Implement comprehensive tests for analysis module functions

fix(tests): Update CLI tests to assert errors on stderr instead of stdout

fix(tests): Adjust MCP integration tests to pass context parameter correctly

fix(tests): Modify service tests to return hash on save functions for consistency
This commit is contained in:
Ole
2026-05-29 15:16:57 +00:00
parent 5b772b2ae5
commit 55d93894ac
18 changed files with 1457 additions and 60 deletions
+7 -7
View File
@@ -197,7 +197,7 @@ def test_compare_too_many_args():
finnkoder = [str(i) for i in range(11)]
result = runner.invoke(app, ["compare"] + finnkoder)
assert result.exit_code == 1
assert "at most 10" in result.stdout.lower()
assert "at most 10" in result.stderr.lower()
def test_compare_with_options():
@@ -286,7 +286,7 @@ def test_resolve_unit_not_found():
mock_resolve.return_value = None
result = runner.invoke(app, ["resolve-unit", "http://example.com"])
assert result.exit_code == 1
assert "could not resolve" in result.stdout.lower()
assert "could not resolve" in result.stderr.lower()
def test_resolve_unit_error():
@@ -336,7 +336,7 @@ def test_get_unit_not_found():
mock_get.return_value = None
result = runner.invoke(app, ["get-unit", "test-code"])
assert result.exit_code == 1
assert "not found" in result.stdout.lower()
assert "not found" in result.stderr.lower()
def test_build_vector_success():
@@ -547,7 +547,7 @@ def test_shortlist_with_limit():
result = runner.invoke(app, ["shortlist", "--limit", "20"])
assert result.exit_code == 0
call_args = mock_get.call_args
assert call_args[1]["limit"] == 20
assert call_args[0][1] == 20
def test_diff_success():
@@ -591,7 +591,7 @@ def test_cache_clear_confirm_yes():
def test_cache_clear_confirm_no():
"""Test cache clear with confirmation rejected."""
result = runner.invoke(app, ["cache", "clear"], input="n\n")
assert result.exit_code == 1
assert result.exit_code == 0
def test_cache_clear_html():
@@ -633,7 +633,7 @@ def test_config_path():
def test_serve_stdio():
"""Test serve command with stdio transport."""
with patch("finn_eiendom.cli.mcp_main") as mock_mcp:
with patch("finn_eiendom.mcp_server.main") as mock_mcp:
result = runner.invoke(app, ["serve", "--transport", "stdio"])
# Should call the MCP main
assert result.exit_code == 0 or "Error" not in result.stdout
@@ -650,7 +650,7 @@ def test_serve_unknown_transport():
"""Test serve command with unknown transport."""
result = runner.invoke(app, ["serve", "--transport", "unknown"])
assert result.exit_code == 1
assert "unknown transport" in result.stdout.lower()
assert "unknown transport" in result.stderr.lower()
# ============================================================================