mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 12:41:02 +02:00
Update tests
This commit is contained in:
parent
9d95e5758b
commit
e50c6f8dda
1 changed files with 17 additions and 1 deletions
|
|
@ -298,4 +298,20 @@ class TestStructuredDataSerializationContracts:
|
||||||
"detected_schemas": ["test"],
|
"detected_schemas": ["test"],
|
||||||
"confidence": 0.9
|
"confidence": 0.9
|
||||||
}
|
}
|
||||||
assert serialize_deserialize_test(QuestionToStructuredQueryResponse, response_data)
|
assert serialize_deserialize_test(QuestionToStructuredQueryResponse, response_data)
|
||||||
|
|
||||||
|
def test_structured_query_serialization(self):
|
||||||
|
"""Test structured query request/response serialization contract"""
|
||||||
|
# Test request
|
||||||
|
request_data = {
|
||||||
|
"question": "Show me all customers"
|
||||||
|
}
|
||||||
|
assert serialize_deserialize_test(StructuredQueryRequest, request_data)
|
||||||
|
|
||||||
|
# Test response
|
||||||
|
response_data = {
|
||||||
|
"error": None,
|
||||||
|
"data": '{"customers": [{"id": "1", "name": "John"}]}',
|
||||||
|
"errors": []
|
||||||
|
}
|
||||||
|
assert serialize_deserialize_test(StructuredQueryResponse, response_data)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue