fix: complete P2 Task 2 schema machine contracts
This commit is contained in:
@@ -221,3 +221,34 @@ def test_vector_index_schema_json_failure_is_safe(monkeypatch, tmp_path):
|
||||
payload = json.loads(response.stdout)
|
||||
assert payload == {"status": "failed", "code": "schema_index_failed"}
|
||||
assert "secret qdrant" not in response.stdout
|
||||
|
||||
|
||||
|
||||
def test_vector_index_schema_human_missing_physical_has_original_error(tmp_path):
|
||||
cfg = _qdrant_runtime_config(tmp_path)
|
||||
_write_schema_artifacts(tmp_path)
|
||||
physical = tmp_path / "artifacts" / "mschema" / "physical.yaml"
|
||||
physical.unlink()
|
||||
response = CliRunner().invoke(app, ["vector", "index-schema", "-c", str(cfg)])
|
||||
assert response.exit_code == 1
|
||||
assert "physical.yaml non trovato. Esegui prima `tht schema introspect`." in response.output
|
||||
|
||||
|
||||
def test_vector_index_schema_json_missing_physical_has_no_stderr_prose(tmp_path):
|
||||
import json
|
||||
|
||||
cfg = _qdrant_runtime_config(tmp_path)
|
||||
_write_schema_artifacts(tmp_path)
|
||||
(tmp_path / "artifacts" / "mschema" / "physical.yaml").unlink()
|
||||
response = CliRunner().invoke(app, ["vector", "index-schema", "--json", "-c", str(cfg)])
|
||||
assert response.exit_code == 1
|
||||
assert response.stderr == ""
|
||||
assert json.loads(response.stdout) == {"status": "failed", "code": "physical_schema_missing"}
|
||||
|
||||
|
||||
def test_vector_index_schema_human_missing_config_has_original_error(tmp_path):
|
||||
cfg = tmp_path / "missing.yaml"
|
||||
response = CliRunner().invoke(app, ["vector", "index-schema", "-c", str(cfg)])
|
||||
assert response.exit_code == 1
|
||||
assert response.output
|
||||
assert "ERRORE:" in response.output
|
||||
|
||||
Reference in New Issue
Block a user