1+ from collections .abc import Callable
12from http import HTTPStatus
2- from typing import Any , Callable
3+ from typing import Any
34from uuid import UUID
45
56import httpx
1213 BotAccountWithSecret ,
1314 EventNotFoundError ,
1415 HandlerCollector ,
16+ ThreadAlreadyExistsError ,
1517 ThreadCreationError ,
1618 ThreadCreationProhibitedError ,
1719 lifespan_wrapper ,
@@ -57,11 +59,10 @@ async def test__create_thread__succeed(
5759 bot_account : BotAccountWithSecret ,
5860) -> None :
5961 # - Arrange -
60- thread_id = "2a8c0d1e-c4d1-4308-b024-6e1a9f4a4b6d"
6162 endpoint = create_mocked_endpoint (
6263 {
6364 "status" : "ok" ,
64- "result" : {"thread_id" : thread_id },
65+ "result" : {"thread_id" : sync_id },
6566 },
6667 HTTPStatus .OK ,
6768 )
@@ -76,7 +77,7 @@ async def test__create_thread__succeed(
7677 )
7778
7879 # - Assert -
79- assert str (created_thread_id ) == thread_id
80+ assert str (created_thread_id ) == sync_id
8081 assert endpoint .called
8182
8283
@@ -143,16 +144,6 @@ async def test__create_thread__succeed(
143144 HTTPStatus .FORBIDDEN ,
144145 ThreadCreationProhibitedError ,
145146 ),
146- (
147- {
148- "status" : "error" ,
149- "reason" : "thread_already_created" ,
150- "errors" : ["Thread already created" ],
151- "error_data" : {"bot_id" : "24348246-6791-4ac0-9d86-b948cd6a0e46" },
152- },
153- HTTPStatus .FORBIDDEN ,
154- ThreadCreationProhibitedError ,
155- ),
156147 (
157148 {
158149 "status" : "error" ,
@@ -176,32 +167,32 @@ async def test__create_thread__succeed(
176167 (
177168 {
178169 "status" : "error" ,
179- "reason" : "event_already_deleted " ,
180- "errors" : ["This event already deleted " ],
170+ "reason" : "event_not_found " ,
171+ "errors" : ["Event not found " ],
181172 "error_data" : {"bot_id" : "24348246-6791-4ac0-9d86-b948cd6a0e46" },
182173 },
183- HTTPStatus .FORBIDDEN ,
184- ThreadCreationProhibitedError ,
174+ HTTPStatus .NOT_FOUND ,
175+ EventNotFoundError ,
185176 ),
186177 (
187178 {
188179 "status" : "error" ,
189- "reason" : "event_not_found " ,
190- "errors" : ["Event not found " ],
180+ "reason" : "event_already_deleted " ,
181+ "errors" : ["This event already deleted " ],
191182 "error_data" : {"bot_id" : "24348246-6791-4ac0-9d86-b948cd6a0e46" },
192183 },
193- HTTPStatus .NOT_FOUND ,
194- EventNotFoundError ,
184+ HTTPStatus .CONFLICT ,
185+ ThreadCreationError ,
195186 ),
196187 (
197188 {
198189 "status" : "error" ,
199- "reason" : "|specified reason| " ,
200- "errors" : ["|specified errors| " ],
201- "error_data" : {},
190+ "reason" : "thread_already_created " ,
191+ "errors" : ["Thread already created " ],
192+ "error_data" : {"bot_id" : "24348246-6791-4ac0-9d86-b948cd6a0e46" },
202193 },
203- HTTPStatus .UNPROCESSABLE_ENTITY ,
204- ThreadCreationError ,
194+ HTTPStatus .CONFLICT ,
195+ ThreadAlreadyExistsError ,
205196 ),
206197 (
207198 {
0 commit comments