Private
Public Access
1
0

running tests

This commit is contained in:
2024-04-20 15:11:28 +02:00
parent ac7c114649
commit db0bf05ab2
5 changed files with 15 additions and 10 deletions

View File

@@ -336,7 +336,7 @@ def mocked_getsmallrowdata_db(*args, **kwargs):
return df
def mocked_getsmallrowdata_pl(*args, **kwargs):
def mocked_read_data(*args, **kwargs):
df = pl.read_csv('rowers/tests/testdata/colsfromdb.csv')
return df

View File

@@ -582,7 +582,7 @@ class DataPrepTests(TestCase):
age = dataprep.calculate_age(born,today=today)
self.assertEqual(age,49)
@patch('rowers.dataprep.getsmallrowdata_pl',side_effect=mocked_getsmallrowdata_uh)
@patch('rowers.dataprep.read_data',side_effect=mocked_getsmallrowdata_uh)
def test_goldmedalstandard(self,mocked_getsmallrowdata_uh):
maxvalue, delta = dataprep.calculate_goldmedalstandard(self.r,self.wuh_otw)
records = CalcAgePerformance.objects.filter(
@@ -703,7 +703,7 @@ class InteractivePlotTests(TestCase):
self.assertFalse(len(div)==0)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.getsmallrowdata_pl', side_effect=mocked_getsmallrowdata_pl)
@patch('rowers.dataprep.read_data', side_effect=mocked_read_data)
def test_interactive_chart(self, mocked_sqlalchemy,
mocked_getsmallrowdata_db):
workout = Workout.objects.filter(user=self.r,workouttype__in=mytypes.rowtypes)[0]
@@ -735,9 +735,9 @@ class InteractivePlotTests(TestCase):
self.assertFalse(len(div)==0)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.getsmallrowdata_pl', side_effect=mocked_getsmallrowdata_pl)
@patch('rowers.dataprep.read_data', side_effect=mocked_read_data)
def test_interactive_flexchart_stacked(self, mocked_sqlalchemy,
mocked_getsmallrowdata_pl):
mocked_read_data):
workout = Workout.objects.filter(user=self.r,workouttype__in=mytypes.rowtypes)[0]
id = workout.id

Binary file not shown.