Private
Public Access
1
0

working NK sync tests

This commit is contained in:
Sander Roosendaal
2021-04-16 17:13:45 +02:00
parent 2ee31d6fc3
commit 8f81c5fc92
7 changed files with 265 additions and 181 deletions

View File

@@ -10,6 +10,8 @@ import pandas as pd
nu = datetime.datetime.now()
from rowers import tasks
import rowers.courses as courses
class fakejob:
def __init__(self):
@@ -53,6 +55,15 @@ class AsyncTaskTests(TestCase):
workouttype = 'water',
)
cs = courses.kmltocourse('rowers/tests/testdata/thyro.kml')
course = cs[0]
cname = course['name']
cnotes = course['description']
polygons = course['polygons']
self.ThyroBaantje = courses.createcourse(self.r,cname,polygons,notes=cnotes)
self.ThyroBaantje.save()
def tearDown(self):
for workout in self.user_workouts:
try:
@@ -68,6 +79,13 @@ class AsyncTaskTests(TestCase):
except:
pass
def test_polygons(self):
polygons = GeoPolygon.objects.all()
polygon = polygons[0]
obj = (polygon.id,polygon.name)
path = tasks.polygon_to_path(obj)
self.assertEqual(len(path),4)
def test_summaryfromsplitdata(self):
splitdata = [
{