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

Class TestLooseTupleTrait

tests/test_traitlets.py:1776–1791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774
1775
1776class TestLooseTupleTrait(TraitTestBase):
1777 obj = LooseTupleTrait()
1778
1779 _default_value = (1, 2, 3)
1780 _good_values = [(1,), [1], (0,), tuple(range(5)), tuple("hello"), ("a", 5), ()]
1781 _bad_values = [10, "hello", {}, None]
1782
1783 def coerce(self, value):
1784 if value is not None:
1785 value = tuple(value)
1786 return value
1787
1788 def test_invalid_args(self):
1789 self.assertRaises(TypeError, Tuple, 5)
1790 self.assertRaises(TypeError, Tuple, default_value="hello")
1791 t = Tuple(Int(), CBytes(), default_value=(1, 5))
1792
1793
1794class MultiTupleTrait(HasTraits):

Callers

nothing calls this directly

Calls 1

LooseTupleTraitClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…