示例#1
0
class FileLockTest(unittest.TestCase):
    def setUp(self):
        self.file_name = "__lock__"
        self.lock = FileLock(self.file_name, timeout=1)
        self.lock.acquire()

    def test_raise(self):
        with self.assertRaises(FileLockException):
            new_lock = FileLock(self.file_name, timeout=1)
            new_lock.acquire()

    def tearDown(self):
        self.lock.release()
示例#2
0
class FileLockTest(unittest.TestCase):

    def setUp(self):
        self.file_name = "__lock__"
        self.lock = FileLock(self.file_name, timeout=1)
        self.lock.acquire()

    def test_raise(self):
        with self.assertRaises(FileLockException):
            new_lock = FileLock(self.file_name, timeout=1)
            new_lock.acquire()

    def tearDown(self):
        self.lock.release()
示例#3
0
 def test_raise(self):
     with self.assertRaises(FileLockException):
         new_lock = FileLock(self.file_name, timeout=1)
         new_lock.acquire()
示例#4
0
 def test_raise(self):
     with self.assertRaises(FileLockException):
         new_lock = FileLock(self.file_name, timeout=1)
         new_lock.acquire()