PEP8 Cleanups

This commit is contained in:
Roberto Rosario
2015-05-18 19:58:03 -04:00
parent c03b2cb09c
commit e9ae8905b4
44 changed files with 129 additions and 409 deletions
+1 -10
View File
@@ -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()