Private
Public Access
1
0

fixing some tests

This commit is contained in:
2024-04-16 15:47:03 +02:00
parent 0936d4cecc
commit eec03965c8
5 changed files with 29 additions and 226 deletions

View File

@@ -38,6 +38,7 @@ from nose.tools import assert_true
from mock import Mock, patch
#from minimocktest import MockTestCase
import pandas as pd
import polars as pl
import arrow
from django.http import HttpResponseRedirect
@@ -335,6 +336,11 @@ def mocked_getsmallrowdata_db(*args, **kwargs):
return df
def mocked_getsmallrowdata_pl(*args, **kwargs):
df = pl.read_csv('rowers/tests/testdata/colsfromdb.csv')
return df
def mocked_getsmallrowdata_db_updatecp(*args, **kwargs): # pragma: no cover
df = pd.read_csv('rowers/tests/testdata/colsfromdb.csv')

View File

@@ -65,6 +65,7 @@ from nose.tools import assert_true
from mock import Mock, patch
#from minimocktest import MockTestCase
import pandas as pd
import polars as pl
import rowers.c2stuff as c2stuff
import rowers.rojabo_stuff as rojabo_stuff

View File

@@ -735,9 +735,9 @@ class InteractivePlotTests(TestCase):
self.assertFalse(len(div)==0)
@patch('rowers.dataprep.create_engine')
@patch('rowers.dataprep.getsmallrowdata_db', side_effect=mocked_getsmallrowdata_db)
@patch('rowers.dataprep.getsmallrowdata_pl', side_effect=mocked_getsmallrowdata_pl)
def test_interactive_flexchart_stacked(self, mocked_sqlalchemy,
mocked_getsmallrowdata_db):
mocked_getsmallrowdata_pl):
workout = Workout.objects.filter(user=self.r,workouttype__in=mytypes.rowtypes)[0]
id = workout.id

Binary file not shown.