lint: fix line length

This commit is contained in:
Guilhem Saurel 2021-08-27 18:04:34 +02:00
parent c03ae0a571
commit eb3c795368
3 changed files with 6 additions and 4 deletions

View file

@ -20,7 +20,8 @@ parser.add_argument(
"-u", "-u",
"--matrix-url", "--matrix-url",
default=os.environ.get("MATRIX_URL", "https://matrix.org"), default=os.environ.get("MATRIX_URL", "https://matrix.org"),
help="matrix homeserver url. Default: `https://matrix.org`. Environment variable: `MATRIX_URL`", help="matrix homeserver url. Default: `https://matrix.org`. "
"Environment variable: `MATRIX_URL`",
) )
parser.add_argument( parser.add_argument(
"-i", "-i",

View file

@ -51,7 +51,8 @@ def wait_available(url: str, key: str, timeout: int = 10) -> bool:
"""Wait until a service answer correctly or timeout.""" """Wait until a service answer correctly or timeout."""
def check_json(url: str, key: str) -> bool: def check_json(url: str, key: str) -> bool:
"""Ensure a service at a given url answers with valid json containing a certain key.""" """Ensure a service at a given url answers
with valid json containing a certain key."""
try: try:
data = httpx.get(url).json() data = httpx.get(url).json()
return key in data return key in data

View file

@ -29,8 +29,8 @@ class BotTest(unittest.IsolatedAsyncioTestCase):
bot_req({"body": 3}, KEY, params={"formatter": "wrong_formatter"}), bot_req({"body": 3}, KEY, params={"formatter": "wrong_formatter"}),
{"status": 400, "ret": "Unknown formatter"}, {"status": 400, "ret": "Unknown formatter"},
) )
# TODO: if the client from matrix_webhook has olm support, this won't be a 403 from synapse, # TODO: if the client from matrix_webhook has olm support,
# but a LocalProtocolError from matrix_webhook # this won't be a 403 from synapse, but a LocalProtocolError from matrix_webhook
self.assertEqual( self.assertEqual(
bot_req({"body": 3}, KEY, "wrong_room"), bot_req({"body": 3}, KEY, "wrong_room"),
{"status": 403, "ret": "Unknown room"}, {"status": 403, "ret": "Unknown room"},