Private
Public Access
1
0

get_workout passing tests using mock upload api, need to add processing of nkid, oarlock params, etc

This commit is contained in:
Sander Roosendaal
2021-04-04 17:22:01 +02:00
parent f82c451e58
commit 13391c0e40
5 changed files with 117 additions and 13 deletions

View File

@@ -101,6 +101,30 @@ def mock_c2open(*args, **kwargs):
print('mock')
return('aap')
def mocked_session(*args, **kwargs):
class MockEngine:
def __init__(self, *args, **kwargs):
self.headers = MockHeaders()
def post(self, *args, **kwargs):
return MockResponse({},200)
class MockHeaders:
def update(*args, **kwargs):
return None
class MockResponse:
def __init__(self, json_data, status_code):
self.json_data = json_data
self.status_code = status_code
self.ok = True
def json(self):
return self.json_data
return MockEngine()
def mocked_sqlalchemy(*args, **kwargs):
# return object with method
@@ -939,7 +963,7 @@ def mocked_requests(*args, **kwargs):
return MockResponse(nkstrokedata,200)
if nkworkoutlisttester.match(args[0]):
return MockResponse(nkworkoutlist,200)