Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2021-12-17 10:58:17 +01:00
parent e1931065f9
commit 1c045f773a
6 changed files with 23 additions and 21 deletions

View File

@@ -120,7 +120,7 @@ def dologging(filename,s):
f.write(' ')
f.write(s)
def to_pace(pace):
def to_pace(pace): # pragma: no cover
minutes, seconds = divmod(pace,60)
seconds, rest = divmod(seconds, 1)
tenths = int(rest*10)
@@ -518,7 +518,7 @@ def custom_exception_handler(exc,message):
return res
def get_strava_stream(r,metric,stravaid,series_type='time',fetchresolution='high',authorizationstring=''):
if r is not None:
if r is not None: # pragma: no cover
authorizationstring = str('Bearer ' + r.stravatoken)
headers = {'Authorization': authorizationstring,
'user-agent': 'sanderroosendaal',
@@ -569,7 +569,7 @@ def allsundays(startdate,enddate):
yield d
d += datetime.timedelta(days=7)
def steps_read_fit(filename,name='',sport='Custom'):
def steps_read_fit(filename,name='',sport='Custom'): # pragma: no cover
authorizationstring = 'Bearer '+settings.WORKOUTS_FIT_TOKEN
url = settings.WORKOUTS_FIT_URL+"/tojson"
headers = {'Authorization':authorizationstring}
@@ -622,7 +622,7 @@ def step_to_time_dist(step,avgspeed = 3.2,ftp=200,ftspm=25,ftv=3.7):
distance = avgspeed*seconds
rscore = 60.*seconds/3600.
if targettype == 'Speed':
if targettype == 'Speed': # pragma: no cover
value = step.get('targetValue',0)
valuelow = step.get('targetValueLow',0)
valuehigh = step.get('targetValueHigh',0)