Example #1
0
 def testLockUnlock(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.lock()
     self.assertTrue(devLock._locked)
     devLock.unlock()
     self.assertFalse(devLock._locked)
Example #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")
Example #3
0
 def testLockUnlock(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.lock()
     self.assertTrue(devLock._locked)
     devLock.unlock()
     self.assertFalse(devLock._locked)
Example #4
0
 def testStop(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.stop()
     self.assertFalse(devLock._locked)
     self.assertTrue(devLock._shouldAbort)
Example #5
0
 def testStop(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     devLock.stop()
     self.assertFalse(devLock._locked)
     self.assertTrue(devLock._shouldAbort)
Example #6
0
 def testEqual(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     self.assertTrue(devLock == device)
Example #7
0
 def testCreate(self):
     device = FakeDevice("d1")
     devLock = DeviceLock(device, FakeTestExec())
     self.assertFalse(devLock._locked)
     self.assertFalse(devLock._shouldAbort)