Skip to content

Commit

Permalink
style: converting more tests to f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sijis committed Oct 29, 2023
1 parent efce69f commit eff39e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/base_backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,9 +1003,9 @@ def test_access_controls(dummy_backend):
dummy_backend.bot_config.ACCESS_CONTROLS = test.get("acl", {})
dummy_backend.bot_config.BOT_ADMINS = test.get("bot_admins", ())
logger = logging.getLogger(__name__)
logger.info("** message: {}".format(test["message"].body))
logger.info("** bot_admins: {}".format(dummy_backend.bot_config.BOT_ADMINS))
logger.info("** acl: {!r}".format(dummy_backend.bot_config.ACCESS_CONTROLS))
logger.info(f"** message: {test['message'].body}")
logger.info(f"** bot_admins: {dummy_backend.bot_config.BOT_ADMINS}")
logger.info(f"** acl: {dummy_backend.bot_config.ACCESS_CONTROLS}")
logger.info(
"** acl_default: {!r}".format(
dummy_backend.bot_config.ACCESS_CONTROLS_DEFAULT
Expand Down
2 changes: 1 addition & 1 deletion tests/commandnotfound_plugin/commandnotfound.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def command_not_found(self, msg, cmd, args, dry_run, emptycmd=False):
if not emptycmd:
return msg, cmd, args

return "Command fell through: {}".format(msg)
return f"Command fell through: {msg}"
6 changes: 3 additions & 3 deletions tests/room_plugin/roomtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def activate(self):

def callback_room_joined(self, room, user, invited_by):
log.info("join")
self.events.put("callback_room_joined {!s}".format(room))
self.events.put(f"callback_room_joined {room}")

def callback_room_left(self, room, user, kicked_by):
self.events.put("callback_room_left {!s}".format(room))
self.events.put(f"callback_room_left {room}")

def callback_room_topic(self, room):
self.events.put("callback_room_topic {}".format(room.topic))
self.events.put(f"callback_room_topic {room.topic}")

def purge(self):
log.info("purge")
Expand Down

0 comments on commit eff39e7

Please sign in to comment.