Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
a047f187
Commit
a047f187
authored
5 years ago
by
Erik Reid
Browse files
Options
Downloads
Patches
Plain Diff
add pipeline methods to mocked redis
parent
2efc6584
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/conftest.py
+8
-2
8 additions, 2 deletions
test/conftest.py
with
8 additions
and
2 deletions
test/conftest.py
+
8
−
2
View file @
a047f187
...
@@ -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
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment