API - add user agent when generating static map - fix #210

This commit is contained in:
Sam
2022-07-13 09:39:33 +02:00
parent 66a24b3f4f
commit 0eaae0e171
3 changed files with 75 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
import json
from typing import Any, Dict, Optional, Tuple
from typing import Dict, Optional, Tuple
from flask import Flask
from flask.testing import FlaskClient
@@ -115,10 +115,20 @@ class ApiTestCaseMixin(RandomMixin):
class CallArgsMixin:
"""call args are returned differently between Python 3.7 and 3.7+"""
@staticmethod
def get_args(call_args: Any) -> Any:
def get_args(call_args: Tuple) -> Tuple:
if len(call_args) == 2:
args, _ = call_args
else:
_, args, _ = call_args
return args
@staticmethod
def get_kwargs(call_args: Tuple) -> Dict:
if len(call_args) == 2:
_, kwargs = call_args
else:
_, _, kwargs = call_args
return kwargs