Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #7
0
 def tearDown(self):
     # make sure the old controller is back
     trellis.install_controller(self.ctrl)
Exemple #8
0
 def tearDown(self):
     # make sure the old controller is back
     trellis.install_controller(self.ctrl)