lint: fix line length
This commit is contained in:
parent
c03ae0a571
commit
eb3c795368
3 changed files with 6 additions and 4 deletions
|
@ -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",
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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"},
|
||||||
|
|
Loading…
Reference in a new issue