Example #1
0
 def testIsDeviceInProgress(self):
     cache = DeviceOperationInProgressCache.getInstance()
     self.assertTrue(cache.checkAndAddDevice("1234"))
     self.assertFalse(cache.checkAndAddDevice("1234"))
     self.assertTrue(cache.isDeviceInProgress("1234"))
     self.assertFalse(cache.isDeviceInProgress("5678"))
     self.assertIsNotNone(cache.doneDevice("1234"))
     self.assertTrue(cache.checkAndAddDevice("1234"))
Example #2
0
 def testIsDeviceInProgress(self):
     cache = DeviceOperationInProgressCache.getInstance()
     self.assertTrue(cache.checkAndAddDevice("1234"))
     self.assertFalse(cache.checkAndAddDevice("1234"))
     self.assertTrue(cache.isDeviceInProgress("1234"))
     self.assertFalse(cache.isDeviceInProgress("5678"))
     self.assertIsNotNone(cache.doneDevice("1234"))
     self.assertTrue(cache.checkAndAddDevice("1234"))
Example #3
0
 def testSingleton(self):
     cache1 = DeviceOperationInProgressCache.getInstance()
     cache2 = DeviceOperationInProgressCache.getInstance()
     
     self.assertEqual(cache1, cache2)
Example #4
0
    def testSingleton(self):
        cache1 = DeviceOperationInProgressCache.getInstance()
        cache2 = DeviceOperationInProgressCache.getInstance()

        self.assertEqual(cache1, cache2)