Пример #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()