MCPcopy Create free account
hub / github.com/ipython/traitlets / test_search_substrings__ctor

Method test_search_substrings__ctor

tests/test_traitlets_enum.py:296–311  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

294 self.assertEqual(example.color, color)
295
296 def test_search_substrings__ctor(self):
297 class FuzzyExample(HasTraits):
298 color = FuzzyEnum(color_choices, help="Color enum", substring_matching=True)
299
300 color = color_choices[-1] # 'YeLLoW'
301 for end in (-1, len(color)):
302 for start in range(1, len(color) - 2):
303 value = color[start:end]
304
305 example = FuzzyExample()
306 example.color = value
307 self.assertEqual(example.color, color)
308
309 example = FuzzyExample()
310 example.color = value.upper()
311 self.assertEqual(example.color, color)
312
313 def test_assign_other_raises(self):
314 def new_trait_class(case_sensitive, substring_matching):

Callers

nothing calls this directly

Calls 1

FuzzyExampleClass · 0.85

Tested by

no test coverage detected