Skip to content

Commit 30f1df8

Browse files
committed
fix: address review feedback for processing and serialization test files
1 parent 6c7b11e commit 30f1df8

3 files changed

Lines changed: 5 additions & 209 deletions

File tree

src/backend/tests/unit/processing/test_expand_flow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tests for langflow.processing.expand_flow module."""
22

33
import pytest
4-
54
from langflow.processing.expand_flow import (
65
CompactEdge,
76
CompactFlowData,
@@ -12,6 +11,7 @@
1211
_get_flat_components,
1312
expand_compact_flow,
1413
)
14+
from pydantic import ValidationError
1515

1616

1717
class TestCompactNode:
@@ -134,7 +134,8 @@ def test_new_field_added_to_template(self):
134134

135135
def test_template_key_copied(self):
136136
"""Verify that expanding a node copies the template dict (shallow) so the
137-
flat_components lookup table can be reused for another node of the same type."""
137+
flat_components lookup table can be reused for another node of the same type.
138+
"""
138139
flat = {
139140
"MyComp": {"template": {"field": {"value": "original"}}},
140141
}
@@ -201,5 +202,5 @@ def test_multiple_nodes(self):
201202
assert len(result["nodes"]) == 2
202203

203204
def test_invalid_compact_data_raises(self):
204-
with pytest.raises(Exception):
205+
with pytest.raises(ValidationError):
205206
expand_compact_flow({"nodes": "invalid"}, {})

src/backend/tests/unit/serialization/test_serialization_extended.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
"""Extended tests for the serialization module - covering internal helpers."""
22

3-
import math
43
from datetime import datetime, timezone
54
from decimal import Decimal
65
from uuid import uuid4
76

87
import numpy as np
98
import pandas as pd
10-
import pytest
11-
from pydantic import BaseModel
12-
139
from langflow.serialization.serialization import (
14-
UNSERIALIZABLE_SENTINEL,
15-
_is_numpy_type,
1610
_serialize_bytes,
1711
_serialize_dataframe,
1812
_serialize_datetime,
19-
_serialize_decimal,
20-
_serialize_dict,
2113
_serialize_dispatcher,
22-
_serialize_instance,
23-
_serialize_iterator,
24-
_serialize_list_tuple,
2514
_serialize_numpy_type,
2615
_serialize_pydantic,
27-
_serialize_primitive,
2816
_serialize_series,
2917
_serialize_str,
30-
_serialize_uuid,
3118
_truncate_value,
3219
serialize,
3320
)
21+
from pydantic import BaseModel
3422

3523

3624
class TestSerializeStrEdgeCases:
@@ -127,27 +115,6 @@ def test_float_inf(self):
127115
assert _serialize_dispatcher(float("inf"), None, None) is None
128116

129117

130-
class TestSerializeInstance:
131-
"""Tests for _serialize_instance."""
132-
133-
def test_custom_class(self):
134-
class MyClass:
135-
def __str__(self):
136-
return "my_instance"
137-
138-
result = _serialize_instance(MyClass())
139-
assert result == "my_instance"
140-
141-
def test_with_repr(self):
142-
class MyClass:
143-
def __repr__(self):
144-
return "MyClass()"
145-
146-
obj = MyClass()
147-
result = _serialize_instance(obj)
148-
assert isinstance(result, str)
149-
150-
151118
class TestSerializeNumpyType:
152119
"""Tests for numpy type serialization."""
153120

src/backend/tests/unit/test_main_utils.py

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)