first attempt at mocking otwcp
This commit is contained in:
@@ -151,6 +151,38 @@ def mocked_stravaexport(f2,workoutname,stravatoken,description='',
|
||||
print "this is mocked strava export"
|
||||
return 1,'success'
|
||||
|
||||
def mocked_fetchcp(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/otwcpresult.csv')
|
||||
delta = df['delta']
|
||||
cpvalue = df['cpvalue']
|
||||
|
||||
try:
|
||||
theworkouts = args[1]
|
||||
except:
|
||||
theworkouts = []
|
||||
|
||||
theids = [int(w.id) for w in theworkouts]
|
||||
|
||||
avgpower = {}
|
||||
thepowers = [203,153,143,152,196,211,223]
|
||||
|
||||
for i in range(len(theids)):
|
||||
avgpower[id[i]] = thepowers[i]
|
||||
|
||||
return delta, cpvalue, avgpower
|
||||
|
||||
def mocked_getcpdata_sql(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/otwcpresult.csv')
|
||||
|
||||
df['cp'] = df['cpvalue']
|
||||
|
||||
return df
|
||||
|
||||
def mocked_cpraw(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/otwcp_df.csv')
|
||||
|
||||
return df
|
||||
|
||||
def StravaActivity():
|
||||
def wait(*args, **kwargs):
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user