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

Method test_this_in_container

tests/test_traitlets.py:1227–1235  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1225 self.assertRaises(TraitError, setattr, b, "t", f)
1226
1227 def test_this_in_container(self):
1228 class Tree(HasTraits):
1229 value = Unicode()
1230 leaves = List(This())
1231
1232 tree = Tree(value="foo", leaves=[Tree(value="bar"), Tree(value="buzz")])
1233
1234 with self.assertRaises(TraitError):
1235 tree.leaves = [1, 2]
1236
1237
1238class TraitTestBase(TestCase):

Callers

nothing calls this directly

Calls 1

TreeClass · 0.85

Tested by

no test coverage detected