Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao committed Jan 14, 2024
1 parent c6d7769 commit 3be7639
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions livekit-rtc/livekit/rtc/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def _on_data_received(self, dp: DataPacket):
if self._callback:
self._callback(msg)
except Exception as e:
logging.warning(
"failed to parse chat message: %s", e, exc_info=e)
logging.warning("failed to parse chat message: %s", e, exc_info=e)


@dataclass
Expand Down
5 changes: 3 additions & 2 deletions livekit-rtc/tests/test_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ def test_message_serialization():
msg2 = ChatMessage.from_jsondict(json.loads(json.dumps(data)))
assert msg2.message == msg.message, "message should be the same"
assert msg2.id == msg.id, "id should be the same"
assert int(msg2.timestamp.timestamp()/1000) == int(msg.timestamp.timestamp() /
1000), "timestamp should be the same"
assert int(msg2.timestamp.timestamp() / 1000) == int(
msg.timestamp.timestamp() / 1000
), "timestamp should be the same"
assert not msg2.deleted, "not deleted"

# deletion is handled
Expand Down

0 comments on commit 3be7639

Please sign in to comment.