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