File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,8 @@ def test_document_entity():
2626
2727
2828def test_conversation_entity ():
29- document_entity = ConversationEntity (name = "tool_name" ,
30- message_id = 1 ,
31- start = 0 ,
32- end = 1 ,
33- confidence = 0.5 )
29+ conversation_entity = ConversationEntity (message_id = 1 , start = 0 , end = 1 )
3430
35- assert document_entity .name == "tool_name"
36- assert document_entity .message_id == "1"
37- assert document_entity .start == 0
38- assert document_entity .end == 1
39- assert document_entity .confidence == 0.5
31+ assert conversation_entity .message_id == "1"
32+ assert conversation_entity .start == 0
33+ assert conversation_entity .end == 1
Original file line number Diff line number Diff line change @@ -15,3 +15,15 @@ def test_text_entity_import(filename: str):
1515 res = list (NDJsonConverter .deserialize (data ))
1616 res = list (NDJsonConverter .serialize (res ))
1717 assert res == data
18+
19+
20+ @pytest .mark .parametrize ("filename" , [
21+ "tests/data/assets/ndjson/conversation_entity_import.json" ,
22+ "tests/data/assets/ndjson/conversation_entity_without_confidence_import.json"
23+ ])
24+ def test_conversation_entity_import (filename : str ):
25+ with open (filename , 'r' ) as file :
26+ data = json .load (file )
27+ res = list (NDJsonConverter .deserialize (data ))
28+ res = list (NDJsonConverter .serialize (res ))
29+ assert res == data
You can’t perform that action at this time.
0 commit comments