File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Tests for langflow.processing.expand_flow module."""
22
33import pytest
4-
54from langflow .processing .expand_flow import (
65 CompactEdge ,
76 CompactFlowData ,
1211 _get_flat_components ,
1312 expand_compact_flow ,
1413)
14+ from pydantic import ValidationError
1515
1616
1717class 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" }, {})
Original file line number Diff line number Diff line change 11"""Extended tests for the serialization module - covering internal helpers."""
22
3- import math
43from datetime import datetime , timezone
54from decimal import Decimal
65from uuid import uuid4
76
87import numpy as np
98import pandas as pd
10- import pytest
11- from pydantic import BaseModel
12-
139from 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
3624class 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-
151118class TestSerializeNumpyType :
152119 """Tests for numpy type serialization."""
153120
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments