lint
parent
6ad8b02b41
commit
5bd30f57af
|
@ -73,9 +73,7 @@ class PowerLevelsTestCase(HomeserverTestCase):
|
|||
|
||||
# Mod the mod
|
||||
room_power_levels = self.helper.get_state(
|
||||
self.room_id,
|
||||
"m.room.power_levels",
|
||||
tok=self.admin_access_token,
|
||||
self.room_id, "m.room.power_levels", tok=self.admin_access_token,
|
||||
)
|
||||
|
||||
# Update existing power levels with mod at PL50
|
||||
|
@ -113,14 +111,9 @@ class PowerLevelsTestCase(HomeserverTestCase):
|
|||
self.room_id,
|
||||
"m.room.server_acl",
|
||||
{
|
||||
"allow": [
|
||||
"*"
|
||||
],
|
||||
"allow": ["*"],
|
||||
"allow_ip_literals": False,
|
||||
"deny": [
|
||||
"*.evil.com",
|
||||
"evil.com"
|
||||
]
|
||||
"deny": ["*.evil.com", "evil.com"],
|
||||
},
|
||||
tok=self.mod_access_token,
|
||||
expect_code=403, # expect failure
|
||||
|
@ -131,14 +124,9 @@ class PowerLevelsTestCase(HomeserverTestCase):
|
|||
self.room_id,
|
||||
"m.room.server_acl",
|
||||
{
|
||||
"allow": [
|
||||
"*"
|
||||
],
|
||||
"allow": ["*"],
|
||||
"allow_ip_literals": False,
|
||||
"deny": [
|
||||
"*.evil.com",
|
||||
"evil.com"
|
||||
]
|
||||
"deny": ["*.evil.com", "evil.com"],
|
||||
},
|
||||
tok=self.user_access_token,
|
||||
expect_code=403, # expect failure
|
||||
|
|
|
@ -142,7 +142,16 @@ class RestHelper(object):
|
|||
|
||||
return channel.json_body
|
||||
|
||||
def _read_write_state(self, room_id, event_type, body, tok, expect_code=200, state_key="", method="GET"):
|
||||
def _read_write_state(
|
||||
self,
|
||||
room_id,
|
||||
event_type,
|
||||
body,
|
||||
tok,
|
||||
expect_code=200,
|
||||
state_key="",
|
||||
method="GET",
|
||||
):
|
||||
path = "/_matrix/client/r0/rooms/%s/state/%s/%s" % (
|
||||
room_id,
|
||||
event_type,
|
||||
|
@ -164,10 +173,14 @@ class RestHelper(object):
|
|||
return channel.json_body
|
||||
|
||||
def get_state(self, room_id, event_type, tok, expect_code=200, state_key=""):
|
||||
return self._read_write_state(room_id, event_type, {}, tok, expect_code, state_key, method="GET")
|
||||
return self._read_write_state(
|
||||
room_id, event_type, {}, tok, expect_code, state_key, method="GET"
|
||||
)
|
||||
|
||||
def send_state(self, room_id, event_type, body, tok, expect_code=200, state_key=""):
|
||||
return self._read_write_state(room_id, event_type, body, tok, expect_code, state_key, method="PUT")
|
||||
return self._read_write_state(
|
||||
room_id, event_type, body, tok, expect_code, state_key, method="PUT"
|
||||
)
|
||||
|
||||
def upload_media(
|
||||
self,
|
||||
|
|
Loading…
Reference in New Issue