Private
Public Access
1
0

increase test coverage

This commit is contained in:
Sander Roosendaal
2021-05-21 14:55:49 +02:00
parent bc5ad4109d
commit 71fdecaf42
15 changed files with 2830 additions and 667 deletions

View File

@@ -385,39 +385,6 @@ class C2Objects(DjangoTestCase):
@patch('rowers.dataprep.create_engine')
def test_strokedata(self, mocked_sqlalchemy):
with open('rowers/tests/testdata/c2stroketestdata.txt','r') as infile:
res = json.load(infile)
strokedata = pd.DataFrame.from_dict(res['data'])
with open('rowers/tests/testdata/c2testdata.txt','r') as infile:
res = json.load(infile)
data = res['data']
from rowers.views import add_workout_from_strokedata
res = add_workout_from_strokedata(self.u,1,data,strokedata,source='c2')
@patch('rowers.dataprep.create_engine')
def test_strokedatanohr(self, mocked_sqlalchemy):
with open('rowers/tests/testdata/c2strokedatanohr.txt','r') as infile:
res = json.load(infile)
strokedata = pd.DataFrame.from_dict(res['data'])
with open('rowers/tests/testdata/c2testdata.txt','r') as infile:
res = json.load(infile)
data = res['data']
from rowers.views import add_workout_from_strokedata
res = add_workout_from_strokedata(self.u,1,data,strokedata,source='c2')
@patch('rowers.tasks.requests.get',side_effect=mocked_requests)
@patch('rowers.tasks.requests.post',side_effect=mocked_requests)
@patch('rowers.tasks.requests.session', side_effect=mocked_requests)