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
93b32d45
Commit
93b32d45
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix unit tests
parent
bed10f98
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/handlers/test_typing.py
+6
-0
6 additions, 0 deletions
tests/handlers/test_typing.py
tests/storage/test_roommember.py
+0
-41
0 additions, 41 deletions
tests/storage/test_roommember.py
with
6 additions
and
41 deletions
tests/handlers/test_typing.py
+
6
−
0
View file @
93b32d45
...
...
@@ -62,6 +62,7 @@ class TypingNotificationsTestCase(unittest.TestCase):
self
.
on_new_event
=
mock_notifier
.
on_new_event
self
.
auth
=
Mock
(
spec
=
[])
self
.
state_handler
=
Mock
()
hs
=
yield
setup_test_homeserver
(
"
test
"
,
...
...
@@ -75,6 +76,7 @@ class TypingNotificationsTestCase(unittest.TestCase):
"
set_received_txn_response
"
,
"
get_destination_retry_timings
"
,
]),
state_handler
=
self
.
state_handler
,
handlers
=
None
,
notifier
=
mock_notifier
,
resource_for_client
=
Mock
(),
...
...
@@ -113,6 +115,10 @@ class TypingNotificationsTestCase(unittest.TestCase):
return
set
(
member
.
domain
for
member
in
self
.
room_members
)
self
.
datastore
.
get_joined_hosts_for_room
=
get_joined_hosts_for_room
def
get_current_user_in_room
(
room_id
):
return
set
(
str
(
u
)
for
u
in
self
.
room_members
)
self
.
state_handler
.
get_current_user_in_room
=
get_current_user_in_room
self
.
auth
.
check_joined_room
=
check_joined_room
# Some local users to test with
...
...
This diff is collapsed.
Click to expand it.
tests/storage/test_roommember.py
+
0
−
41
View file @
93b32d45
...
...
@@ -78,44 +78,3 @@ class RoomMemberStoreTestCase(unittest.TestCase):
)
)]
)
@defer.inlineCallbacks
def
test_room_hosts
(
self
):
yield
self
.
inject_room_member
(
self
.
room
,
self
.
u_alice
,
Membership
.
JOIN
)
self
.
assertEquals
(
{
"
test
"
},
(
yield
self
.
store
.
get_joined_hosts_for_room
(
self
.
room
.
to_string
()))
)
# Should still have just one host after second join from it
yield
self
.
inject_room_member
(
self
.
room
,
self
.
u_bob
,
Membership
.
JOIN
)
self
.
assertEquals
(
{
"
test
"
},
(
yield
self
.
store
.
get_joined_hosts_for_room
(
self
.
room
.
to_string
()))
)
# Should now have two hosts after join from other host
yield
self
.
inject_room_member
(
self
.
room
,
self
.
u_charlie
,
Membership
.
JOIN
)
self
.
assertEquals
(
{
"
test
"
,
"
elsewhere
"
},
(
yield
self
.
store
.
get_joined_hosts_for_room
(
self
.
room
.
to_string
()))
)
# Should still have both hosts
yield
self
.
inject_room_member
(
self
.
room
,
self
.
u_alice
,
Membership
.
LEAVE
)
self
.
assertEquals
(
{
"
test
"
,
"
elsewhere
"
},
(
yield
self
.
store
.
get_joined_hosts_for_room
(
self
.
room
.
to_string
()))
)
# Should have only one host after other leaves
yield
self
.
inject_room_member
(
self
.
room
,
self
.
u_charlie
,
Membership
.
LEAVE
)
self
.
assertEquals
(
{
"
test
"
},
(
yield
self
.
store
.
get_joined_hosts_for_room
(
self
.
room
.
to_string
()))
)
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