File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,3 +242,26 @@ def test_lowercase_count(self):
242242 X_tr = transformer .fit_transform (X )
243243
244244 assert X_tr ["text_lowercase_count" ].tolist () == [4 , 0 ]
245+
246+ def test_variables_list_non_strings_raises_error (self ):
247+ """Test that a list of non-string variables raises ValueError."""
248+ with pytest .raises (ValueError , match = "variables must be" ):
249+ TextFeatures (variables = [1 , 2 ])
250+
251+ def test_features_list_non_strings_raises_error (self ):
252+ """Test that a list of non-string features raises ValueError."""
253+ with pytest .raises (ValueError , match = "features must be" ):
254+ TextFeatures (features = [1 , 2 ])
255+
256+ def test_more_tags (self ):
257+ """Test _more_tags returns expected tags."""
258+ transformer = TextFeatures ()
259+ tags = transformer ._more_tags ()
260+ assert tags ["allow_nan" ] is True
261+ assert tags ["variables" ] == "categorical"
262+
263+ def test_sklearn_tags (self ):
264+ """Test __sklearn_tags__ returns expected tags."""
265+ transformer = TextFeatures ()
266+ tags = transformer .__sklearn_tags__ ()
267+ assert tags .input_tags .allow_nan is True
You can’t perform that action at this time.
0 commit comments