From 15f4431bebc4326ca6e4878f44e9e08258baf9b4 Mon Sep 17 00:00:00 2001 From: helloqiu Date: Mon, 27 May 2019 17:51:56 +0800 Subject: [PATCH] style: format with new version of yapf --- tests/test_client.py | 22 ++++++++-------------- werobot/messages/events.py | 4 ++-- werobot/session/mongodbstorage.py | 4 +--- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index eff86528..4d7b6750 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -224,16 +224,14 @@ class TestClientMenuClass(BaseTestClass): "type": "click", "name": u"歌手简介", "key": "V1001_TODAY_SINGER" - }, - { + }, { "name": u"菜单", "sub_button": [ { "type": "view", "name": u"搜索", "url": "http://www.soso.com/" - }, - { + }, { "type": "view", "name": u"视频", "url": "http://v.qq.com/" @@ -543,16 +541,14 @@ class TestClientCustomMenuClass(BaseTestClass): "type": "click", "name": u"今日歌曲", "key": "V1001_TODAY_MUSIC" - }, - { + }, { "name": u"菜单", "sub_button": [ { "type": "view", "name": u"搜索", "url": "http://www.soso.com/" - }, - { + }, { "type": "view", "name": u"视频", "url": "http://v.qq.com/" @@ -1544,12 +1540,10 @@ def create_tag_callback(self, request): body = json.loads(request.body.decode("utf-8")) assert body == {"tag": {"name": self.create_tag_name}} return 200, JSON_HEADER, json.dumps( - { - "tag": { - "id": self.create_tag_id, - "name": self.create_tag_name - } - } + {"tag": { + "id": self.create_tag_id, + "name": self.create_tag_name + }} ) def update_tag_callback(self, request): diff --git a/werobot/messages/events.py b/werobot/messages/events.py index 159f7583..41b5f6b1 100644 --- a/werobot/messages/events.py +++ b/werobot/messages/events.py @@ -65,8 +65,8 @@ def __init__(self, message): else: self.pic_list.append( { - 'pic_md5_sum': message['SendPicsInfo']['PicList']. - pop('item')['PicMd5Sum'] + 'pic_md5_sum': message['SendPicsInfo'] + ['PicList'].pop('item')['PicMd5Sum'] } ) diff --git a/werobot/session/mongodbstorage.py b/werobot/session/mongodbstorage.py index 12017398..fb7d28e4 100644 --- a/werobot/session/mongodbstorage.py +++ b/werobot/session/mongodbstorage.py @@ -52,9 +52,7 @@ def set(self, id, value): """ session = json_dumps(value) self.collection.replace_one( - { - "wechat_id": id - }, { + {"wechat_id": id}, { "wechat_id": id, "session": session },