Skip to content
Snippets Groups Projects
Verified Commit 21a41390 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

feat(tests): update AiProviderServiceTest with JSON formatted message

- Changed the format of the message content in the AiProviderServiceTest to use JSON instead of a string representation.
- Added assertions to verify the expected message format in the responses.
parent 10c41a5a
No related branches found
No related tags found
1 merge request!59Ajouter service ia & détection bots user agents
Pipeline #1025 failed
......@@ -30,7 +30,7 @@ class AiProviderServiceTest extends TestCase
'index' => 0,
'message' => [
'role' => 'assistant',
'content' => '{\'message\': \'Why don\'t scientists trust atoms? Because they make up everything!\'}',
'content' => "{\n \"message\": \"Why don't scientists trust atoms? Because they make up everything!\"\n}",
'refusal' => null,
],
'logprobs' => null,
......@@ -85,6 +85,7 @@ public function test_prompt_with_pictures_sends_correct_request()
$uploadedPicture
);
$this->assertEquals(['message' => "Why don't scientists trust at...thing!"], $response);
}
public function test_prompt_sends_correct_request()
......@@ -108,7 +109,7 @@ public function test_prompt_sends_correct_request()
'Tell me a joke.'
);
$this->assertEquals(['response' => 'test-response'], $response);
$this->assertEquals(['message' => "Why don't scientists trust at...thing!"], $response);
}
public function test_prompt_with_pictures_handles_transcoding_failure()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment