get_workout passing tests using mock upload api, need to add processing of nkid, oarlock params, etc
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user