Skip to content
Snippets Groups Projects
Commit a047f187 authored by Erik Reid's avatar Erik Reid
Browse files

add pipeline methods to mocked redis

parent 2efc6584
No related branches found
No related tags found
No related merge requests found
...@@ -98,12 +98,12 @@ class MockedRedis(object): ...@@ -98,12 +98,12 @@ class MockedRedis(object):
def scan_iter(self, glob=None): def scan_iter(self, glob=None):
if not glob: if not glob:
for k in MockedRedis.db.keys(): for k in list(MockedRedis.db.keys()):
yield k.encode('utf-8') yield k.encode('utf-8')
m = re.match(r'^([^*]+)\*$', glob) m = re.match(r'^([^*]+)\*$', glob)
assert m # all expected globs are like this assert m # all expected globs are like this
for k in MockedRedis.db.keys(): for k in list(MockedRedis.db.keys()):
if k.startswith(m.group(1)): if k.startswith(m.group(1)):
yield k.encode('utf-8') yield k.encode('utf-8')
...@@ -114,6 +114,12 @@ class MockedRedis(object): ...@@ -114,6 +114,12 @@ class MockedRedis(object):
# only called from testing routes (hopefully) # only called from testing routes (hopefully)
pass pass
def execute(self):
pass
def pipeline(self, *args, **kwargs):
return self
@pytest.fixture @pytest.fixture
def cached_test_data(): def cached_test_data():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment