PEP8 Cleanups
This commit is contained in:
@@ -4,13 +4,9 @@ import time
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from .exceptions import LockError#, StaleLock
|
||||
from .exceptions import LockError
|
||||
from .models import Lock
|
||||
|
||||
# Notice: StaleLock exception and tests are not available until more changes are
|
||||
# backported.
|
||||
# TODO: backport stale lock code
|
||||
|
||||
|
||||
class LockTestCase(TestCase):
|
||||
def test_exclusive(self):
|
||||
@@ -46,8 +42,6 @@ class LockTestCase(TestCase):
|
||||
def test_double_release(self):
|
||||
lock_1 = Lock.objects.acquire_lock(name='test_lock_1')
|
||||
lock_1.release()
|
||||
#with self.assertRaises(StaleLock):
|
||||
# lock_1.release()
|
||||
|
||||
def test_release_expired(self):
|
||||
lock_1 = Lock.objects.acquire_lock(name='test_lock_1', timeout=1)
|
||||
@@ -59,11 +53,8 @@ class LockTestCase(TestCase):
|
||||
# would be successfull, even after an extended lapse of time
|
||||
|
||||
def test_release_expired_reaquired(self):
|
||||
lock_1 = Lock.objects.acquire_lock(name='test_lock_1', timeout=1)
|
||||
time.sleep(2)
|
||||
lock_2 = Lock.objects.acquire_lock(name='test_lock_1', timeout=1)
|
||||
#with self.assertRaises(StaleLock):
|
||||
# lock_1.release()
|
||||
|
||||
# Cleanup
|
||||
lock_2.release()
|
||||
|
||||
Reference in New Issue
Block a user