summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Brown <paul90brown@gmail.com>2017-06-22 22:20:50 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-06-26 10:31:31 -0400
commiteec8a9731b4ee3255ee8426c73e4087dc38693d9 (patch)
treefb669f27d311eed74a1b72bcfe6a2b8c2e3d909c /tests
parent2f82d8f3c09a5b0379648e11bc5a7f504e502e9a (diff)
downloaddogpile-cache-eec8a9731b4ee3255ee8426c73e4087dc38693d9.tar.gz
Produce consistent string for __repr__() of NoValue
The :attr:`.api.NO_VALUE` constant now has a fixed ``__repr__()`` output, so that scenarios where this constant's string value ends up being used as a cache key do not create multiple values. Pull request courtesy Paul Brown. Change-Id: Iecc9633d6be562bc6821bf4ee2ff3f29d1b31e80 Pull-request: https://bitbucket.org/zzzeek/dogpile.cache/pull-requests/61
Diffstat (limited to 'tests')
-rw-r--r--tests/cache/test_region.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/cache/test_region.py b/tests/cache/test_region.py
index b08b1ad..1a69b27 100644
--- a/tests/cache/test_region.py
+++ b/tests/cache/test_region.py
@@ -17,6 +17,11 @@ def key_mangler(key):
return "HI!" + key
+class APITest(TestCase):
+ def test_no_value_str(self):
+ eq_(str(NO_VALUE), "<dogpile.cache.api.NoValue object>")
+
+
class RegionTest(TestCase):
def _region(self, init_args={}, config_args={}, backend="mock"):