MCPcopy Create free account
hub / github.com/LabPy/lantz / test_Self_exceptions

Method test_Self_exceptions

lantz/testsuite/test_driver.py:324–349  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

322 self.assertEqual(n.action1(), 'action1')
323
324 def test_Self_exceptions(self):
325
326 class X(Driver):
327
328 @Feat(units=Self.units)
329 def value(self):
330 return 1
331
332 @value.setter
333 def value(self, value):
334 pass
335
336 @Feat()
337 def units(self):
338 return self._units
339
340 @units.setter
341 def units(self, value):
342 self._units = value
343
344 x = X()
345 self.assertRaises(Exception, getattr, x, 'value')
346 self.assertRaises(Exception, setattr, x, 'value', 1)
347 x.units = 'ms'
348 self.assertEqual(x.feats.value.units, 'ms')
349 self.assertEqual(x.value, Q_(1, 'ms'))
350
351
352 def test_Self(self):

Callers

nothing calls this directly

Calls 1

XClass · 0.85

Tested by

no test coverage detected