File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Orange/widgets/data/tests Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -277,8 +277,28 @@ def test_handles_builtins_in_expression(self):
277277 self .assertTrue (
278278 FeatureConstructorHandler ().is_valid_item (
279279 OWFeatureConstructor .descriptors ,
280- StringDescriptor ("X" , "str(A)" ),
280+ StringDescriptor ("X" , "str(A) + str(B) " ),
281281 {"A" : vartype (DiscreteVariable )},
282+ {"B" : vartype (DiscreteVariable )}
283+ )
284+ )
285+
286+ # no variables is also ok
287+ self .assertTrue (
288+ FeatureConstructorHandler ().is_valid_item (
289+ OWFeatureConstructor .descriptors ,
290+ StringDescriptor ("X" , "str('foo')" ),
291+ {},
292+ {}
293+ )
294+ )
295+
296+ # should fail on unknown variables
297+ self .assertFalse (
298+ FeatureConstructorHandler ().is_valid_item (
299+ OWFeatureConstructor .descriptors ,
300+ StringDescriptor ("X" , "str(X)" ),
301+ {},
282302 {}
283303 )
284304 )
You can’t perform that action at this time.
0 commit comments