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

Method test_Self

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

Source from the content-addressed store, hash-verified

350
351
352 def test_Self(self):
353
354 class X(Driver):
355
356 @Feat(units=Self.a_value_units('s'))
357 def a_value(self):
358 return 1
359
360 @Feat()
361 def a_value_units(self):
362 return self._units
363
364 @a_value_units.setter
365 def a_value_units(self, new_units):
366 self._units = new_units
367
368 x = X()
369 self.assertEqual(x.feats.a_value.units, 's')
370 self.assertEqual(x.a_value, Q_(1, 's'))
371 x.a_value_units = 'ms'
372 self.assertEqual(x.feats.a_value.units, 'ms')
373 self.assertEqual(x.a_value, Q_(1, 'ms'))
374
375
376if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

XClass · 0.85

Tested by

no test coverage detected