()
| 380 | |
| 381 | |
| 382 | def test_bad_openai_call(): |
| 383 | try: |
| 384 | client.chat.completions.create( |
| 385 | model="gpt-3.5-turbo-blaster", |
| 386 | messages=[{"role": "system", "content": "count to 10"}], |
| 387 | stream=True, |
| 388 | ) |
| 389 | assert False |
| 390 | except Exception: |
| 391 | pass |
| 392 | |
| 393 | if not TEST_LAST_LOGGED: |
| 394 | return |
| 395 | |
| 396 | last_logged = ( |
| 397 | client.openpipe_reporting_client.base_client.local_testing_only_get_latest_logged_call() |
| 398 | ) |
| 399 | assert ( |
| 400 | last_logged.error_message == "The model `gpt-3.5-turbo-blaster` does not exist" |
| 401 | ) |
| 402 | assert last_logged.status_code == 404 |
| 403 | |
| 404 | |
| 405 | def test_bad_openpipe_call(): |
nothing calls this directly
no test coverage detected