Skip to content

Commit 28ba425

Browse files
authored
Fix equality checks with floating point values (#2658)
1 parent 68d7e5e commit 28ba425

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

backend/tests/apps/ai/agent/tools/rag/generator_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for the RAG Generator."""
22

3+
import math
34
import os
45
from unittest.mock import MagicMock, patch
56

@@ -320,4 +321,4 @@ def test_generate_answer_none_openai_response(self):
320321
def test_constants(self):
321322
"""Test class constants have expected values."""
322323
assert Generator.MAX_TOKENS == 2000
323-
assert Generator.TEMPERATURE == 0.5
324+
assert math.isclose(Generator.TEMPERATURE, 0.5)

backend/tests/apps/slack/common/question_detector_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for question detector functionality."""
22

3+
import math
34
import os
45
from unittest.mock import MagicMock, patch
56

@@ -182,7 +183,7 @@ def test_mocked_initialization(self):
182183
def test_class_constants(self, detector):
183184
"""Test that class constants are properly defined."""
184185
assert detector.MAX_TOKENS == 10
185-
assert detector.TEMPERATURE == 0.1
186+
assert math.isclose(detector.TEMPERATURE, 0.1)
186187
assert detector.CHAT_MODEL == "gpt-4o-mini"
187188

188189
def test_openai_client_initialization(self, detector):

0 commit comments

Comments
 (0)