diff options
author | Jamie Lennox <jamielennox@gmail.com> | 2016-07-05 10:20:59 +1000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-06-26 11:55:30 -0400 |
commit | e5508c09894add09a15132d8ec7857735d7ce25e (patch) | |
tree | e0e0ad90955aa1c6a4c0bd9dd12b18b8bd6524c5 /tests | |
parent | eec8a9731b4ee3255ee8426c73e4087dc38693d9 (diff) | |
download | dogpile-cache-e5508c09894add09a15132d8ec7857735d7ce25e.tar.gz |
Raise PluginNotFound exception when not found
A new exception class :class:`.exception.PluginNotFound` is now
raised when a particular cache plugin class cannot be located
either as a setuptools entrypoint or as a registered backend.
Previously, a plain ``Exception`` was thrown. Pull request
courtesy Jamie Lennox.
Change-Id: Iceab2d613d2d802618dc0bed8ec2db694176c788
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cache/test_region.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/cache/test_region.py b/tests/cache/test_region.py index 1a69b27..87a9889 100644 --- a/tests/cache/test_region.py +++ b/tests/cache/test_region.py @@ -152,6 +152,15 @@ class RegionTest(TestCase): ) eq_(reg.is_configured, False) + def test_invalid_backend(self): + reg = CacheRegion() + assert_raises_message( + exception.PluginNotFound, + "Couldn't find cache plugin to load: unknown", + reg.configure, 'unknown' + ) + eq_(reg.is_configured, False) + def test_set_get_value(self): reg = self._region() reg.set("some key", "some value") |