mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-20 06:31:02 +08:00
Refactor: reformat all code for lefthook using ruff and gofmt (#16585)
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
import math
|
||||
from common.float_utils import get_float
|
||||
|
||||
class TestGetFloat:
|
||||
|
||||
class TestGetFloat:
|
||||
def test_valid_float_string(self):
|
||||
"""Test conversion of valid float strings"""
|
||||
assert get_float("3.14") == 3.14
|
||||
@@ -66,8 +66,8 @@ class TestGetFloat:
|
||||
|
||||
def test_special_float_strings(self):
|
||||
"""Test handling of special float strings"""
|
||||
assert get_float("inf") == float('inf')
|
||||
assert get_float("-inf") == float('-inf')
|
||||
assert get_float("inf") == float("inf")
|
||||
assert get_float("-inf") == float("-inf")
|
||||
|
||||
# NaN should return -inf according to our function's design
|
||||
result = get_float("nan")
|
||||
@@ -85,4 +85,4 @@ class TestGetFloat:
|
||||
assert get_float(" 3.14 ") == 3.14
|
||||
result = get_float(" invalid ")
|
||||
assert math.isinf(result)
|
||||
assert result < 0
|
||||
assert result < 0
|
||||
|
||||
Reference in New Issue
Block a user