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

Method test_this_class

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

Source from the content-addressed store, hash-verified

1179
1180class TestThis(TestCase):
1181 def test_this_class(self):
1182 class Foo(HasTraits):
1183 this = This["Foo"]()
1184
1185 f = Foo()
1186 self.assertEqual(f.this, None)
1187 g = Foo()
1188 f.this = g
1189 self.assertEqual(f.this, g)
1190 self.assertRaises(TraitError, setattr, f, "this", 10)
1191
1192 def test_this_inst(self):
1193 class Foo(HasTraits):

Callers

nothing calls this directly

Calls 1

FooClass · 0.70

Tested by

no test coverage detected