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