Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 5a1974b

Browse files
committed
remove asynctest
1 parent d0e703f commit 5a1974b

10 files changed

Lines changed: 508 additions & 766 deletions

File tree

beacon_api/api/exceptions.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ def process_exception_data(request: Dict, host: str, error_code: int, error: str
3535
# include datasetIds only if they are specified
3636
# as per specification if they don't exist all datatsets will be queried
3737
# Only one of `alternateBases` or `variantType` is required, validated by schema
38-
oneof_fields = ["alternateBases", "variantType", "start", "end", "startMin", "startMax", "endMin", "endMax", "datasetIds"]
38+
oneof_fields = [
39+
"alternateBases",
40+
"variantType",
41+
"start",
42+
"end",
43+
"startMin",
44+
"startMax",
45+
"endMin",
46+
"endMax",
47+
"datasetIds",
48+
]
3949
data["alleleRequest"].update({k: request.get(k) for k in oneof_fields if k in request})
4050

4151
return data
@@ -65,11 +75,7 @@ class BeaconUnauthorised(web.HTTPUnauthorized):
6575
def __init__(self, request: Dict, host: str, error: str, error_message: str) -> None:
6676
"""Return custom unauthorized exception."""
6777
data = process_exception_data(request, host, 401, error)
68-
headers_401 = {
69-
"WWW-Authenticate": f'Bearer realm="{CONFIG_INFO.url}"\n\
70-
error="{error}"\n\
71-
error_description="{error_message}"'
72-
}
78+
headers_401 = {"WWW-Authenticate": f"""Bearer realm=\"{CONFIG_INFO.url}\",error=\"{error},\" error_description=\"{error_message}\""""}
7379
super().__init__(
7480
content_type="application/json",
7581
text=ujson.dumps(data, escape_forward_slashes=False),

beacon_api/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ def main():
127127
# sslcontext.check_hostname = False
128128
web.run_app(
129129
init(),
130-
host=os.environ.get("HOST", "0.0.0.0"),
130+
host=os.environ.get("HOST", "0.0.0.0"), # nosec
131131
port=os.environ.get("PORT", "5050"),
132132
shutdown_timeout=0,
133133
ssl_context=None,
134-
) # nosec # nosec
134+
)
135135

136136

137137
if __name__ == "__main__":

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ cyvcf2==0.30.14
77
uvloop==0.16.0
88
aiocache==0.11.1
99
ujson==5.1.0
10-
aiomcache==0.6.0
1110
Authlib==0.15.5
1211
gunicorn==20.1.0

setup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"uvloop==0.16.0",
4747
"cyvcf2==0.30.14",
4848
"aiocache==0.11.1",
49-
"aiomcache==0.6.0",
5049
"ujson==5.1.0",
5150
],
5251
extras_require={
@@ -63,7 +62,6 @@
6362
"tox==3.24.4",
6463
"flake8==4.0.1",
6564
"flake8-docstrings==1.6.0",
66-
"asynctest==0.13.0",
6765
"aioresponses==0.7.2",
6866
"black==21.12b0",
6967
],

0 commit comments

Comments
 (0)