gets strava owner id thru api
This commit is contained in:
@@ -606,6 +606,8 @@ def mocked_requests(*args, **kwargs):
|
||||
uastrokesjson = json.load(open('rowers/tests/testdata/uastrokes.txt','r'))
|
||||
uauserjson = json.load(open('rowers/tests/testdata/uauser.txt','r'))
|
||||
|
||||
stravaathletejson = json.load(open('rowers/tests/testdata/strava_athlete.txt'))
|
||||
|
||||
class MockResponse:
|
||||
def __init__(self, json_data, status_code):
|
||||
self.json_data = json_data
|
||||
@@ -660,6 +662,10 @@ def mocked_requests(*args, **kwargs):
|
||||
c2workoutlistregex = '.*?concept2\.com\/api\/users\/me\/results\?page=\d'
|
||||
c2workoutlisttester = re.compile(c2workoutlistregex)
|
||||
|
||||
stravaathleteregex = '.*?strava\.com\/api\/v3\/athlete$'
|
||||
stravaathletetester = re.compile(stravaathleteregex)
|
||||
|
||||
|
||||
stravaworkoutlistregex = '.*?strava\.com\/api\/v3\/athlete\/activities'
|
||||
stravaworkoutlisttester = re.compile(stravaworkoutlistregex)
|
||||
|
||||
@@ -703,6 +709,10 @@ def mocked_requests(*args, **kwargs):
|
||||
tpuploadregex = '.*?trainingpeaks\.com\/v1\/file'
|
||||
tpuploadtester = re.compile(tpuploadregex)
|
||||
|
||||
if stravaathletetester.match(args[0]):
|
||||
json_data = stravaathletejson
|
||||
return MockResponse(json_data,200)
|
||||
|
||||
if polartester.match(args[0]):
|
||||
json_data = polar_json
|
||||
return MockResponse(json_data,200)
|
||||
|
||||
Reference in New Issue
Block a user