Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
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
Maunium
synapse
Commits
04c7f357
Commit
04c7f357
authored
9 years ago
by
Paul "LeoNerd" Evans
Browse files
Options
Downloads
Patches
Plain Diff
Various minor fixes to unit-test structure around typing notifications
parent
0268d402
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/handlers/test_typing.py
+7
-0
7 additions, 0 deletions
tests/handlers/test_typing.py
tests/rest/client/v1/test_typing.py
+4
-2
4 additions, 2 deletions
tests/rest/client/v1/test_typing.py
with
11 additions
and
2 deletions
tests/handlers/test_typing.py
+
7
−
0
View file @
04c7f357
...
...
@@ -126,6 +126,13 @@ class TypingNotificationsTestCase(unittest.TestCase):
return
defer
.
succeed
([])
self
.
room_member_handler
.
get_room_members
=
get_room_members
def
get_joined_rooms_for_user
(
user
):
if
user
in
self
.
room_members
:
return
defer
.
succeed
([
self
.
room_id
])
else
:
return
defer
.
succeed
([])
self
.
room_member_handler
.
get_joined_rooms_for_user
=
get_joined_rooms_for_user
@defer.inlineCallbacks
def
fetch_room_distributions_into
(
room_id
,
localusers
=
None
,
remotedomains
=
None
,
ignore_user
=
None
):
...
...
This diff is collapsed.
Click to expand it.
tests/rest/client/v1/test_typing.py
+
4
−
2
View file @
04c7f357
...
...
@@ -34,6 +34,8 @@ class RoomTypingTestCase(RestTestCase):
"""
Tests /rooms/$room_id/typing/$user_id REST API.
"""
user_id
=
"
@sid:red
"
user
=
UserID
.
from_string
(
user_id
)
@defer.inlineCallbacks
def
setUp
(
self
):
self
.
clock
=
MockClock
()
...
...
@@ -75,7 +77,7 @@ class RoomTypingTestCase(RestTestCase):
def
get_room_members
(
room_id
):
if
room_id
==
self
.
room_id
:
return
defer
.
succeed
([
UserID
.
from_string
(
self
.
user
_id
)
])
return
defer
.
succeed
([
self
.
user
])
else
:
return
defer
.
succeed
([])
...
...
@@ -115,7 +117,7 @@ class RoomTypingTestCase(RestTestCase):
self
.
assertEquals
(
200
,
code
)
self
.
assertEquals
(
self
.
event_source
.
get_current_key
(),
1
)
events
=
yield
self
.
event_source
.
get_new_events_for_user
(
self
.
user
_id
,
0
,
None
)
events
=
yield
self
.
event_source
.
get_new_events_for_user
(
self
.
user
,
0
,
None
)
self
.
assertEquals
(
events
[
0
],
[
...
...
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