ref: Auto-fix ruff rules in tests (#4154)
This commit is contained in:
parent
51b3909d60
commit
45c8f98692
80 changed files with 359 additions and 456 deletions
|
|
@ -3,7 +3,7 @@ from langflow.utils.connection_string_parser import transform_connection_string
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"connection_string, expected",
|
||||
("connection_string", "expected"),
|
||||
[
|
||||
("protocol:user:password@host", "protocol:user:password@host"),
|
||||
("protocol:user@host", "protocol:user@host"),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from langflow.base.data.utils import format_directory_path
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"input_path, expected",
|
||||
("input_path", "expected"),
|
||||
[
|
||||
# Test case 1: Standard path with no newlines (no change expected)
|
||||
("/home/user/documents/file.txt", "/home/user/documents/file.txt"),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
from langflow.base.data.utils import format_directory_path
|
||||
import pytest
|
||||
from langflow.base.data.utils import format_directory_path
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"input_path, expected",
|
||||
("input_path", "expected"),
|
||||
[
|
||||
# Test case 1: Standard path with no newlines
|
||||
("/home/user/documents/file.txt", "/home/user/documents/file.txt"),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
import math
|
||||
|
||||
import pytest
|
||||
from langflow.utils.util_strings import truncate_long_strings
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"input_data, max_length, expected",
|
||||
("input_data", "max_length", "expected"),
|
||||
[
|
||||
# Test case 1: String shorter than max_length
|
||||
("short string", 20, "short string"),
|
||||
|
|
@ -20,7 +22,7 @@ from langflow.utils.util_strings import truncate_long_strings
|
|||
# Test case 7: Integer input
|
||||
(12345, 3, 12345),
|
||||
# Test case 8: Float input
|
||||
(3.14159, 4, 3.14159),
|
||||
(math.pi, 4, math.pi),
|
||||
# Test case 9: Boolean input
|
||||
(True, 2, True),
|
||||
# Test case 10: None input
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
from langflow.utils.util_strings import truncate_long_strings
|
||||
from langflow.utils.constants import MAX_TEXT_LENGTH
|
||||
import pytest
|
||||
from langflow.utils.constants import MAX_TEXT_LENGTH
|
||||
from langflow.utils.util_strings import truncate_long_strings
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"input_data, max_length, expected",
|
||||
("input_data", "max_length", "expected"),
|
||||
[
|
||||
# Test case 1: Simple string truncation
|
||||
({"key": "a" * 100}, 10, {"key": "a" * 10 + "..."}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue