Extend spam checker to allow for multiple modules (#7435)

This commit is contained in:
Andrew Morgan 2020-05-08 19:25:48 +01:00 committed by GitHub
parent 616af44137
commit 67feea8044
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 94 additions and 59 deletions

View file

@ -185,7 +185,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
# Allow all users.
return False
spam_checker.spam_checker = AllowAll()
spam_checker.spam_checkers = [AllowAll()]
# The results do not change:
# We get one search result when searching for user2 by user1.
@ -198,7 +198,7 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase):
# All users are spammy.
return True
spam_checker.spam_checker = BlockAll()
spam_checker.spam_checkers = [BlockAll()]
# User1 now gets no search results for any of the other users.
s = self.get_success(self.handler.search_users(u1, "user2", 10))