Ejemplo n.º 1
0
 def testValueUsed(self):
     v = trellis.Value(42)
     ctrl = self.mocker.replace(self.ctrl)  #'peak.events.stm.ctrl')
     ctrl.used(v)
     self.mocker.replay()
     trellis.install_controller(ctrl)
     self.assertEqual(v.value, 42)
Ejemplo n.º 2
0
 def testValueUsed(self):
     v = trellis.Value(42)
     ctrl = self.mocker.replace(self.ctrl)  #'peak.events.stm.ctrl')
     ctrl.used(v)
     self.mocker.replay()
     trellis.install_controller(ctrl)
     self.assertEqual(v.value, 42)
Ejemplo n.º 3
0
 def testValueUnchanged(self):
     v = trellis.Value(42)
     ctrl = self.mocker.replace(self.ctrl)
     ctrl.lock(v)
     mocker.expect(ctrl.changed(v)).count(0)
     self.mocker.replay()
     trellis.install_controller(ctrl)
     v.value = 42
     self.assertEqual(v.value, 42)
Ejemplo n.º 4
0
 def testValueChanged(self):
     v = trellis.Value(42)
     old_ctrl, ctrl = self.ctrl, self.mocker.replace(self.ctrl)
     ctrl.lock(v)
     ctrl.changed(v)
     self.mocker.replay()
     trellis.install_controller(ctrl)
     v.value = 43
     self.assertEqual(v.value, 43)
Ejemplo n.º 5
0
 def testValueUnchanged(self):
     v = trellis.Value(42)
     ctrl = self.mocker.replace(self.ctrl)
     ctrl.lock(v)
     mocker.expect(ctrl.changed(v)).count(0)
     self.mocker.replay()
     trellis.install_controller(ctrl)
     v.value = 42
     self.assertEqual(v.value, 42)
Ejemplo n.º 6
0
 def testValueChanged(self):
     v = trellis.Value(42)
     old_ctrl, ctrl = self.ctrl, self.mocker.replace(self.ctrl)
     ctrl.lock(v)
     ctrl.changed(v)
     self.mocker.replay()
     trellis.install_controller(ctrl)
     v.value = 43
     self.assertEqual(v.value, 43)
Ejemplo n.º 7
0
 def tearDown(self):
     # make sure the old controller is back
     trellis.install_controller(self.ctrl)
Ejemplo n.º 8
0
 def tearDown(self):
     # make sure the old controller is back
     trellis.install_controller(self.ctrl)