From 867825b607037e603f7446b7f8fb90adaf03a371 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 18 May 2021 08:34:06 +0200 Subject: [PATCH] coverage and test --- rowers/garmin_stuff.py | 14 +++++++------- rowers/tasks.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rowers/garmin_stuff.py b/rowers/garmin_stuff.py index 43335cc8..f82334a7 100644 --- a/rowers/garmin_stuff.py +++ b/rowers/garmin_stuff.py @@ -269,7 +269,7 @@ def step_to_garmin(step,order=0): if targetType is not None and targetType.lower() == "power": targetType = 'POWER' if targetValue is not None and targetValue <= 1000: - targetValueType = 'PERCENT' + targetValueType = 'PERCENT' # pragma: no cover else: targetValueType = None targetValue -= 1000 @@ -277,25 +277,25 @@ def step_to_garmin(step,order=0): try: targetValueLow = step['dict']['targetValueLow'] - if targetValueLow == 0 and targetValue is not None and targetValue > 0: + if targetValueLow == 0 and targetValue is not None and targetValue > 0: # pragma: no cover targetValueLow = targetValue targetValue = None elif targetValueLow == 0: # pragma: no cover targetValueLow = None - elif targetValueLow <= 1000 and targetType == 'POWER': + elif targetValueLow <= 1000 and targetType == 'POWER': # pragma: no cover targetValueType = 'PERCENT' - elif targetValueLow > 1000 and targetType == 'POWER': + elif targetValueLow > 1000 and targetType == 'POWER': # pragma: no cover targetValueLow -= 1000 except KeyError: targetValueLow = None try: targetValueHigh = step['dict']['targetValueHigh'] - if targetValue is not None and targetValue > 0 and targetValueHigh == 0: + if targetValue is not None and targetValue > 0 and targetValueHigh == 0: # pragma: no cover targetValueHigh = targetValue targetValue = 0 - elif targetValueHigh <= 1000 and targetType == 'POWER': + elif targetValueHigh <= 1000 and targetType == 'POWER': # pragma: no cover targetValueType = 'PERCENT' - elif targetValueHigh > 1000 and targetType == 'POWER': + elif targetValueHigh > 1000 and targetType == 'POWER': # pragma: no cover targetValueHigh -= 1000 elif targetValueHigh == 0: # pragma: no cover targetValueHigh = None diff --git a/rowers/tasks.py b/rowers/tasks.py index ea06d589..5ce2807d 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -2993,7 +2993,7 @@ def handle_c2_async_workout(alldata,userid,c2token,c2id,delaysec,defaulttimezone verified = data['verified'] try: startdatetime = iso8601.parse_date(data['date_utc']) - except: + except: # pragma: no cover startdatetime = iso8601.parse_date(data['date']) weightclass = data['weight_class']