adding a few more tests - coverage
This commit is contained in:
@@ -348,18 +348,25 @@ def handle_strava_sync(stravatoken,workoutid,filename,name,activity_type,descrip
|
||||
try:
|
||||
act = client.update_activity(res.id,activity_type=activity_type,
|
||||
description=description,device_name='Rowsandall.com')
|
||||
dologging('stravalog.log','Updating activity {id} to {type}'.format(
|
||||
id=workoutid,
|
||||
type=activity_type
|
||||
))
|
||||
except TypeError: # pragma: no cover
|
||||
act = client.update_activity(res.id,activity_type=activity_type,
|
||||
description=description)
|
||||
dologging('stravalog.log','Updating activity {id} to {type}'.format(
|
||||
id=workoutid,
|
||||
type=activity_type
|
||||
))
|
||||
except: # pragma: no cover
|
||||
e = sys.exc_info()[0]
|
||||
t = time.localtime()
|
||||
timestamp = bytes('{t}'.format(t=time.strftime('%b-%d-%Y_%H%M', t)),'utf-8')
|
||||
with open('stravalog.log','ab') as f:
|
||||
f.write(b'\n')
|
||||
f.write(timestamp)
|
||||
f.write(str(e))
|
||||
|
||||
dologging('stravalog.log','Update activity failed with error {e} for {id} to {type}'.format(
|
||||
id=workoutid,
|
||||
type=activity_type,
|
||||
e=e
|
||||
))
|
||||
try:
|
||||
os.remove(filename)
|
||||
except: # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user