Ejemplo n.º 1
0
 def testLockUnlock(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.lock()
     self.assertTrue(devLock._locked)
     devLock.unlock()
     self.assertFalse(devLock._locked)
Ejemplo n.º 2
0
 def testGetattr(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     box = {"TestName": "TestValue"}
     device.box = box
     self.assertEqual(box, devLock.box)
     device.connected = False
     try:
         devLock.box
     except TestAbortError, err:
         self.failUnlessEqual(str(err), "Device disconnected")
Ejemplo n.º 3
0
 def testLockUnlock(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.lock()
     self.assertTrue(devLock._locked)
     devLock.unlock()
     self.assertFalse(devLock._locked)
Ejemplo n.º 4
0
 def testStop(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.stop()
     self.assertFalse(devLock._locked)
     self.assertTrue(devLock._shouldAbort)
Ejemplo n.º 5
0
 def testStop(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.stop()
     self.assertFalse(devLock._locked)
     self.assertTrue(devLock._shouldAbort)
Ejemplo n.º 6
0
 def testEqual(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     self.assertTrue(devLock == device)
Ejemplo n.º 7
0
 def testCreate(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     self.assertFalse(devLock._locked)
     self.assertFalse(devLock._shouldAbort)