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

Method test_link_broken_at_source

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

Source from the content-addressed store, hash-verified

2162 self.assertEqual(a.value, 3)
2163
2164 def test_link_broken_at_source(self):
2165 class MyClass(HasTraits):
2166 i = Int()
2167 j = Int()
2168
2169 @observe("j")
2170 def another_update(self, change):
2171 self.i = change.new * 2
2172
2173 mc = MyClass()
2174 l = link((mc, "i"), (mc, "j")) # noqa: E741
2175 self.assertRaises(TraitError, setattr, mc, "i", 2)
2176
2177 def test_link_broken_at_target(self):
2178 class MyClass(HasTraits):

Callers

nothing calls this directly

Calls 2

linkClass · 0.90
MyClassClass · 0.85

Tested by

no test coverage detected