Skip to content

Commit

Permalink
Add test for invalid storage subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Oct 5, 2015
1 parent 72d1692 commit 8439e5d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ def test_redis_sentinel(self):
time.sleep(0.1)
self.assertTrue(limiter.hit(per_min))

def test_pluggable_storage_invalid_construction(self):
with self.assertRaises(ConfigurationError):
class _(Storage):
def incr(self, key, expiry, elastic_expiry=False):
return

def get(self, key):
return 0

def get_expiry(self, key):
return time.time()

def test_pluggable_storage_no_moving_window(self):
class MyStorage(Storage):
Expand Down

0 comments on commit 8439e5d

Please sign in to comment.