Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
0620d27f
Commit
0620d27f
authored
6 years ago
by
Matthew Hodgson
Browse files
Options
Downloads
Patches
Plain Diff
flake8
parent
0a7ee0ab
Loading
Loading
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/storage/test_state.py
+12
-12
12 additions, 12 deletions
tests/storage/test_state.py
with
12 additions
and
12 deletions
tests/storage/test_state.py
+
12
−
12
View file @
0620d27f
...
...
@@ -170,15 +170,15 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e2
.
type
,
e2
.
state_key
):
e2
,
},
state
)
##################################
# _get_some_state_from_cache tests
##################################
##################################
#####################
# _get_some_state_from_cache tests
against a full cache
##################################
#####################
room_id
=
self
.
room
.
to_string
()
group_ids
=
yield
self
.
store
.
get_state_groups_ids
(
room_id
,
[
e5
.
event_id
])
group
=
group_ids
.
keys
()[
0
]
# test
that
_get_some_state_from_cache correctly filters out members with types=[]
# test _get_some_state_from_cache correctly filters out members with types=[]
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[],
filtered_types
=
[
EventTypes
.
Member
]
)
...
...
@@ -189,7 +189,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e2
.
type
,
e2
.
state_key
):
e2
.
event_id
,
},
state_dict
)
# test
that
_get_some_state_from_cache correctly filters
out
members with
types=
wildcard
# test _get_some_state_from_cache correctly filters
in
members with wildcard
types
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[(
EventTypes
.
Member
,
None
)],
filtered_types
=
[
EventTypes
.
Member
]
)
...
...
@@ -203,7 +203,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e5
.
type
,
e5
.
state_key
):
e5
.
event_id
,
},
state_dict
)
# test
that
_get_some_state_from_cache correctly filters
out
members with
types=
specific
# test _get_some_state_from_cache correctly filters
in
members with specific
types
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[(
EventTypes
.
Member
,
e5
.
state_key
)],
filtered_types
=
[
EventTypes
.
Member
]
)
...
...
@@ -215,7 +215,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e5
.
type
,
e5
.
state_key
):
e5
.
event_id
,
},
state_dict
)
# test
that
_get_some_state_from_cache correctly filters
out
members with
types=
specific
# test _get_some_state_from_cache correctly filters
in
members with specific
types
# and no filtered_types
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[(
EventTypes
.
Member
,
e5
.
state_key
)],
filtered_types
=
None
...
...
@@ -269,10 +269,10 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e5
.
type
,
e5
.
state_key
):
e5
.
event_id
,
})
############################################
#######
############################################
# test that things work with a partial cache
# test
that
_get_some_state_from_cache correctly filters out members with types=[]
# test _get_some_state_from_cache correctly filters out members with types=[]
room_id
=
self
.
room
.
to_string
()
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[],
filtered_types
=
[
EventTypes
.
Member
]
...
...
@@ -283,7 +283,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e1
.
type
,
e1
.
state_key
):
e1
.
event_id
,
},
state_dict
)
# test
that
_get_some_state_from_cache correctly filters
out
members wi
th types=wi
ldcard
# test _get_some_state_from_cache correctly filters
in
members wildcard
types
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[(
EventTypes
.
Member
,
None
)],
filtered_types
=
[
EventTypes
.
Member
]
)
...
...
@@ -296,7 +296,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e5
.
type
,
e5
.
state_key
):
e5
.
event_id
,
},
state_dict
)
# test
that
_get_some_state_from_cache correctly filters
out
members with
types=
specific
# test _get_some_state_from_cache correctly filters
in
members with specific
types
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[(
EventTypes
.
Member
,
e5
.
state_key
)],
filtered_types
=
[
EventTypes
.
Member
]
)
...
...
@@ -307,7 +307,7 @@ class StateStoreTestCase(tests.unittest.TestCase):
(
e5
.
type
,
e5
.
state_key
):
e5
.
event_id
,
},
state_dict
)
# test
that
_get_some_state_from_cache correctly filters
out
members with
types=
specific
# test _get_some_state_from_cache correctly filters
in
members with specific
types
# and no filtered_types
(
state_dict
,
is_all
)
=
yield
self
.
store
.
_get_some_state_from_cache
(
group
,
[(
EventTypes
.
Member
,
e5
.
state_key
)],
filtered_types
=
None
...
...
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