@@ -239,17 +239,26 @@ def get_sentinel():
239239 def test_existing_flow_exists (self ):
240240 # create a flow
241241 nb = sklearn .naive_bayes .GaussianNB ()
242- flow = openml .flows .sklearn_to_flow (nb )
243- flow , _ = self ._add_sentinel_to_flow_name (flow , None )
244- #publish the flow
245- flow = flow .publish ()
246- #redownload the flow
247- flow = openml .flows .get_flow (flow .flow_id )
248-
249- # check if flow exists can find it
250- flow = openml .flows .get_flow (flow .flow_id )
251- downloaded_flow_id = openml .flows .flow_exists (flow .name , flow .external_version )
252- self .assertEquals (downloaded_flow_id , flow .flow_id )
242+
243+ steps = [('imputation' , sklearn .preprocessing .Imputer (strategy = 'median' )),
244+ ('hotencoding' , sklearn .preprocessing .OneHotEncoder (sparse = False ,
245+ handle_unknown = 'ignore' )),
246+ ('variencethreshold' , sklearn .feature_selection .VarianceThreshold ()),
247+ ('classifier' , sklearn .tree .DecisionTreeClassifier ())]
248+ complicated = sklearn .pipeline .Pipeline (steps = steps )
249+
250+ for classifier in [nb , complicated ]:
251+ flow = openml .flows .sklearn_to_flow (classifier )
252+ flow , _ = self ._add_sentinel_to_flow_name (flow , None )
253+ #publish the flow
254+ flow = flow .publish ()
255+ #redownload the flow
256+ flow = openml .flows .get_flow (flow .flow_id )
257+
258+ # check if flow exists can find it
259+ flow = openml .flows .get_flow (flow .flow_id )
260+ downloaded_flow_id = openml .flows .flow_exists (flow .name , flow .external_version )
261+ self .assertEquals (downloaded_flow_id , flow .flow_id )
253262
254263 def test_sklearn_to_upload_to_flow (self ):
255264 iris = sklearn .datasets .load_iris ()
0 commit comments