Skip to content

Commit ab208e0

Browse files
committed
Add comments and deserialization check to unit test.
1 parent 0a44218 commit ab208e0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/test_flows/test_flow_functions.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,15 @@ def test_are_flows_equal_ignore_if_older(self):
232232
def test_sklearn_to_flow_list_of_lists(self):
233233
from sklearn.preprocessing import OrdinalEncoder
234234
ordinal_encoder = OrdinalEncoder(categories=[[0, 1], [0, 1]])
235+
236+
# Test serialization works
235237
flow = openml.flows.sklearn_to_flow(ordinal_encoder)
238+
239+
# Test flow is accepted by server
236240
self._add_sentinel_to_flow_name(flow)
237241
flow.publish()
242+
243+
# Test deserialization works
244+
server_flow = openml.flows.get_flow(flow.flow_id, reinstantiate=True)
245+
self.assertEqual(server_flow.parameters['categories'], '[[0, 1], [0, 1]]')
246+
self.assertEqual(server_flow.model.categories, flow.model.categories)

0 commit comments

Comments
 (0)