cleanups: typing + whitespaces
This commit is contained in:
parent
f14b0f8225
commit
b4c874e244
3 changed files with 6 additions and 3 deletions
|
|
@ -83,10 +83,14 @@ def build_data(apikey, method, **kw):
|
|||
})
|
||||
|
||||
|
||||
def api_call(app, params, status=None):
|
||||
def api_call(app, params, status=None, assert_no_error=False):
|
||||
response = app.post(
|
||||
API_URL, content_type='application/json', params=params, status=status,
|
||||
headers=[('Content-Type', 'application/json')])
|
||||
if assert_no_error:
|
||||
err_resp = response.json.get('error')
|
||||
if err_resp:
|
||||
raise AssertionError(f'ERROR in response: {err_resp}')
|
||||
return response
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ def safe_float(val, default=None) -> float:
|
|||
return val
|
||||
|
||||
|
||||
def base64_to_str(text) -> str:
|
||||
def base64_to_str(text: str | bytes) -> str:
|
||||
return safe_str(base64.encodebytes(safe_bytes(text))).strip()
|
||||
|
||||
|
||||
|
|
|
|||
1
setup.py
1
setup.py
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright (C) 2010-2023 RhodeCode GmbH
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue