Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Run linter on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier committed Jun 30, 2020
1 parent 994f267 commit 00fd951
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
4 changes: 1 addition & 3 deletions tests/rest/client/v1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ def send_event(

return channel.json_body

def redact(
self, room_id, event_id, txn_id=None, tok=None, expect_code=200
):
def redact(self, room_id, event_id, txn_id=None, tok=None, expect_code=200):
if txn_id is None:
txn_id = "m%s" % (str(time.time()))

Expand Down
21 changes: 9 additions & 12 deletions tests/rest/client/v2_alpha/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ def prepare(self, reactor, clock, hs):
# Change the power levels of the room so that the second user can send state
# events.
self.power_levels = {
"users": {
self.user_id: 100,
self.user2: 100,
},
"users": {self.user_id: 100, self.user2: 100},
"users_default": 0,
"events": {
"m.room.name": 50,
Expand All @@ -366,14 +363,14 @@ def prepare(self, reactor, clock, hs):
"m.room.avatar": 50,
"m.room.tombstone": 100,
"m.room.server_acl": 100,
"m.room.encryption": 100
"m.room.encryption": 100,
},
"events_default": 0,
"state_default": 50,
"ban": 50,
"kick": 50,
"redact": 50,
"invite": 0
"invite": 0,
}
self.helper.send_state(
self.room_id, EventTypes.PowerLevels, self.power_levels, tok=self.tok,
Expand Down Expand Up @@ -405,7 +402,10 @@ def test_unread_counts(self):
# Send a read receipt to tell the server we've read the latest event.
body = json.dumps({"m.read": res["event_id"]}).encode("utf8")
request, channel = self.make_request(
"POST", "/rooms/%s/read_markers" % self.room_id, body, access_token=self.tok,
"POST",
"/rooms/%s/read_markers" % self.room_id,
body,
access_token=self.tok,
)
self.render(request)
self.assertEqual(channel.code, 200, channel.json_body)
Expand Down Expand Up @@ -449,7 +449,7 @@ def test_unread_counts(self):
content={
"body": "hello",
"msgtype": "m.text",
"m.relates_to": {"rel_type": RelationTypes.REPLACE}
"m.relates_to": {"rel_type": RelationTypes.REPLACE},
},
tok=self.tok2,
)
Expand All @@ -459,10 +459,7 @@ def test_unread_counts(self):
self.helper.send_event(
room_id=self.room_id,
type=EventTypes.Message,
content={
"body": "hello",
"msgtype": "m.notice",
},
content={"body": "hello", "msgtype": "m.notice"},
tok=self.tok2,
)
self._check_unread_count(5)
Expand Down

0 comments on commit 00fd951

Please sign in to comment.