summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-01-05 21:59:43 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-01-05 21:59:43 -0500
commit896b6d4cb35ee2048dbd74c256f37f0942ee9e06 (patch)
tree7a466e6d3575ef5e4daa6d84ba25f13c70c10c2c /tests
parent02f00ac418fd4e77f0e5da1738dac3ace5c364b9 (diff)
downloaddogpile-core-896b6d4cb35ee2048dbd74c256f37f0942ee9e06.tar.gz
- expire time of None means "never expire".
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dogpile.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_dogpile.py b/tests/test_dogpile.py
index 98b9de6..bc0031a 100644
--- a/tests/test_dogpile.py
+++ b/tests/test_dogpile.py
@@ -8,7 +8,7 @@ import math
import logging
log = logging.getLogger(__name__)
-class DogpileTest(TestCase):
+class ConcurrencyTest(TestCase):
# expiretime, time to create, num usages, time spend using, delay btw usage
timings = [
# quick one
@@ -327,7 +327,7 @@ class DogpileTest(TestCase):
"expected %d" % (len(the_resource),
expected_generations)
-class SingleCreateTest(TestCase):
+class DogpileTest(TestCase):
def test_single_create(self):
dogpile = Dogpile(2)
the_resource = [0]
@@ -347,3 +347,18 @@ class SingleCreateTest(TestCase):
with dogpile.acquire(create_resource):
assert the_resource[0] == 2
+
+ def test_no_expiration(self):
+ dogpile = Dogpile(None)
+ the_resource = [0]
+
+ def create_resource():
+ the_resource[0] += 1
+
+ with dogpile.acquire(create_resource):
+ assert the_resource[0] == 1
+
+ with dogpile.acquire(create_resource):
+ assert the_resource[0] == 1
+
+ \ No newline at end of file