making tests work with powerhr
This commit is contained in:
@@ -173,10 +173,6 @@ def mocked_getsmallrowdata_db(*args, **kwargs):
|
||||
|
||||
return df
|
||||
|
||||
def mocked_read_cols_df_sql(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/readcols.csv')
|
||||
|
||||
return df,[]
|
||||
|
||||
def mocked_getsmallrowdata_db_water(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/colsfromdb.csv')
|
||||
@@ -204,11 +200,11 @@ def mocked_read_df_cols_sql_multistats(ids,columns,convertnewtons=True):
|
||||
|
||||
return df, extracols
|
||||
|
||||
def mocked_read_df_cols_sql(ids, columns, convertnewtons=True):
|
||||
df = pd.read_csv('rowers/tests/testdata/fake_strokedata.csv')
|
||||
extracols = []
|
||||
def mocked_read_cols_df_sql(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/readcols.csv')
|
||||
|
||||
return df,[]
|
||||
|
||||
return df, extracols
|
||||
|
||||
def mock_workout_summaries(*args, **kwargs):
|
||||
df = pd.read_csv('rowers/tests/testdata/workout_summaries.csv')
|
||||
|
||||
81014
rowers/tests/testdata/cumstats.csv
vendored
81014
rowers/tests/testdata/cumstats.csv
vendored
File diff suppressed because it is too large
Load Diff
1536
rowers/tests/testdata/getrowdata_mock.csv
vendored
1536
rowers/tests/testdata/getrowdata_mock.csv
vendored
File diff suppressed because it is too large
Load Diff
43842
rowers/tests/testdata/readcols.csv
vendored
43842
rowers/tests/testdata/readcols.csv
vendored
File diff suppressed because it is too large
Load Diff
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -514,10 +514,10 @@ def statsdata(workouts, options):
|
||||
}
|
||||
|
||||
fieldlist,fielddict = dataprep.getstatsfields()
|
||||
|
||||
# prepare data frame
|
||||
datadf,extracols = dataprep.read_cols_df_sql(ids,fieldlist)
|
||||
|
||||
|
||||
datadf = dataprep.clean_df_stats(datadf,workstrokesonly=workstrokesonly)
|
||||
|
||||
# Create stats
|
||||
@@ -525,6 +525,7 @@ def statsdata(workouts, options):
|
||||
fielddict.pop('workoutstate')
|
||||
fielddict.pop('workoutid')
|
||||
|
||||
|
||||
for field,verbosename in fielddict.items():
|
||||
thedict = {
|
||||
'mean':datadf[field].mean(),
|
||||
|
||||
@@ -11,12 +11,18 @@ https://docs.djangoproject.com/en/1.9/ref/settings/
|
||||
"""
|
||||
from .settings import *
|
||||
|
||||
#DATABASES = {
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.sqlite3',
|
||||
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
# 'HOST': 'localhost',
|
||||
# },
|
||||
try:
|
||||
use_sqlite = CFG['use_sqlite']
|
||||
except KeyError:
|
||||
use_sqlite = False
|
||||
|
||||
if use_sqlite:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
||||
'HOST': 'localhost',
|
||||
},
|
||||
# 'TEST': {
|
||||
# 'CHARSET': 'utf8',
|
||||
# 'COLLATION': 'utf8_general_ci',
|
||||
@@ -30,7 +36,7 @@ from .settings import *
|
||||
# 'HOST': 'store3.rosti.cz',
|
||||
# 'PORT': '3306',
|
||||
# }
|
||||
# }
|
||||
}
|
||||
|
||||
BROKER_URL = 'redis://localhost:6379/0'
|
||||
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
|
||||
|
||||
Reference in New Issue
Block a user