Skip to content

Commit

Permalink
black format (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldsink committed Jul 20, 2021
1 parent ff05e50 commit fdf7e9c
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/test_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class WeChatErrorCodeTestCase(unittest.TestCase):
""" ensure python compatibility """
"""ensure python compatibility"""

def test_error_code(self):
self.assertEqual(-1000, WeChatErrorCode.SYSTEM_ERROR.value)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_parse_subscribe_scan_product_event(self):
self.assertEqual("keystr", msg.key)

def test_parse_user_authorize_invoice_event(self):
""" Test parsing xml for UserAuthorizeInvoiceEvent """
"""Test parsing xml for UserAuthorizeInvoiceEvent"""
from wechatpy.events import UserAuthorizeInvoiceEvent

xml = """<xml>
Expand All @@ -282,7 +282,7 @@ def test_parse_user_authorize_invoice_event(self):
self.assertEqual(None, msg.auth_source)

def test_parse_update_invoice_status_event(self):
""" Test parsing xml for UpdateInvoiceStatusEvent """
"""Test parsing xml for UpdateInvoiceStatusEvent"""
from wechatpy.events import UpdateInvoiceStatusEvent

xml = """<xml>
Expand All @@ -303,7 +303,7 @@ def test_parse_update_invoice_status_event(self):
self.assertEqual("186921658591", msg.code)

def test_parse_submit_invoice_title_event(self):
""" Test parsing xml for SubmitInvoiceTitleEvent """
"""Test parsing xml for SubmitInvoiceTitleEvent"""
from wechatpy.events import SubmitInvoiceTitleEvent

xml = """<xml>
Expand Down
2 changes: 1 addition & 1 deletion wechatpy/client/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class BaseWeChatAPI:
""" WeChat API base class """
"""WeChat API base class"""

def __init__(self, client=None):
self._client = client
Expand Down
4 changes: 2 additions & 2 deletions wechatpy/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def post(self, url, **kwargs):
return self._request(method="post", url_or_endpoint=url, **kwargs)

def _fetch_access_token(self, url, params):
""" The real fetch access token """
"""The real fetch access token"""
logger.info("Fetching access token")
res = self._http.get(url=url, params=params)
try:
Expand Down Expand Up @@ -166,7 +166,7 @@ def fetch_access_token(self):

@property
def access_token(self):
""" WeChat access token """
"""WeChat access token"""
access_token = self.session.get(self.access_token_key)
if access_token:
if not self.expires_at:
Expand Down
4 changes: 2 additions & 2 deletions wechatpy/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def fetch_access_token(self):
)

def _fetch_access_token(self, url, data):
""" The real fetch access token """
"""The real fetch access token"""
logger.info("Fetching component access token")
res = self._http.post(url=url, data=data)
try:
Expand Down Expand Up @@ -167,7 +167,7 @@ def _fetch_access_token(self, url, data):

@property
def access_token(self):
""" WeChat component access token """
"""WeChat component access token"""
access_token = self.session.get("component_access_token")
if access_token:
if not self.expires_at:
Expand Down
4 changes: 2 additions & 2 deletions wechatpy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@unique
class UserFormInfoFlag(Enum):
""" 微信卡券会员卡格式化的选项类型 """
"""微信卡券会员卡格式化的选项类型"""

MOBILE = "USER_FORM_INFO_FLAG_MOBILE" # 手机号
SEX = "USER_FORM_INFO_FLAG_SEX" # 性别
Expand All @@ -21,7 +21,7 @@ class UserFormInfoFlag(Enum):

@unique
class ReimburseStatus(Enum):
""" 发票报销状态 """
"""发票报销状态"""

INIT = "INVOICE_REIMBURSE_INIT" # 初始状态,未锁定,可提交报销
LOCK = "INVOICE_REIMBURSE_LOCK" # 已锁定,无法重复提交报销
Expand Down
2 changes: 1 addition & 1 deletion wechatpy/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def from_xml(cls, value):
raise NotImplementedError()

def __getitem__(self, item):
""" 有时微信会推嵌套的消息,mypy 的类型检查会愣住,所以加个函数敷衍一下 mypy """
"""有时微信会推嵌套的消息,mypy 的类型检查会愣住,所以加个函数敷衍一下 mypy"""
raise NotImplementedError()

def __repr__(self):
Expand Down
2 changes: 1 addition & 1 deletion wechatpy/pay/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class BaseWeChatPayAPI:
""" WeChat Pay API base class """
"""WeChat Pay API base class"""

def __init__(self, client=None):
self._client = client
Expand Down
2 changes: 1 addition & 1 deletion wechatpy/work/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def access_token_key(self):
return f"{self.corp_id}_{self.secret[:10]}_access_token"

def fetch_access_token(self):
""" Fetch access token"""
"""Fetch access token"""
return self._fetch_access_token(
url="https://qyapi.weixin.qq.com/cgi-bin/gettoken",
params={"corpid": self.corp_id, "corpsecret": self.secret},
Expand Down

0 comments on commit fdf7e9c

Please sign in to comment.