Permalink
Browse files

Added coverage for create_store.

  • Loading branch information...
1 parent dd00894 commit 313a2f2c09a456c2a26e807aab498b7ef65b5b4c @mmerickel mmerickel committed Mar 13, 2012
@@ -6,7 +6,7 @@ def retrieve(self, key):
:param key: The key to retrieve. Keys are always ascii-safe strings.
"""
- raise NotImplementedError
+ raise NotImplementedError # pragma: no cover
def store(self, key, value, expires=None):
""" This method stores value in the storage.
@@ -22,14 +22,14 @@ def store(self, key, value, expires=None):
:meth:`datetime.timedelta` object before the stored
data should be removed.
"""
- raise NotImplementedError
+ raise NotImplementedError # pragma: no cover
def delete(self, key):
""" This method deletes data from the storage.
:param key: The key of the data to be removed.
"""
- raise NotImplementedError
+ raise NotImplementedError # pragma: no cover
def purge_expired(self):
""" This method purges all expired data from the storage.
@@ -38,4 +38,4 @@ def purge_expired(self):
is called. Backends that automatically expire old data must still
implement this method, but can do nothing.
"""
- raise NotImplementedError
+ raise NotImplementedError # pragma: no cover
View
@@ -17,7 +17,7 @@ def _load_backend(name):
return backend
except ImportError:
module = _load_entry_point(name)
- if module is None:
+ if module is not None:
return module
raise ConfigurationError(
'Could not determine backend for "%s"' % name)
@@ -1,4 +1,4 @@
-import unittest
+import unittest2 as unittest
class TestMemoryStore(unittest.TestCase):
@@ -1,4 +1,4 @@
-import unittest
+import unittest2 as unittest
class TestSQLStore(unittest.TestCase):
@@ -23,3 +23,8 @@ def test_create_store_from_settings_with_prefix(self):
from anykeystore.backends.memory import MemoryStore
self.assertTrue(isinstance(store, MemoryStore))
+
+ def test_create_nonexistent_store(self):
+ from anykeystore import create_store
+ from anykeystore.exceptions import ConfigurationError
+ self.assertRaises(ConfigurationError, create_store, '_dumbdb')

0 comments on commit 313a2f2

Please sign in to comment.