Unit test fixes due to NodeODM update

pull/668/head
Piero Toffanin 2019-05-26 11:40:05 -04:00
rodzic 8918b9376a
commit 86e43b9040
4 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -133,7 +133,6 @@ class Task(models.Model):
ASSETS_MAP = {
'all.zip': 'all.zip',
'orthophoto.tif': os.path.join('odm_orthophoto', 'odm_orthophoto.tif'),
'orthophoto.png': os.path.join('odm_orthophoto', 'odm_orthophoto.png'),
'orthophoto.mbtiles': os.path.join('odm_orthophoto', 'odm_orthophoto.mbtiles'),
'georeferenced_model.las': os.path.join('odm_georeferencing', 'odm_georeferenced_model.las'),
'georeferenced_model.laz': os.path.join('odm_georeferencing', 'odm_georeferenced_model.laz'),

Wyświetl plik

@ -324,7 +324,7 @@ class TestApiTask(BootTransactionTestCase):
# Can download assets
for asset in list(task.ASSETS_MAP.keys()):
res = client.get("/api/projects/{}/tasks/{}/download/{}".format(project.id, task.id, asset))
self.assertTrue(res.status_code == status.HTTP_200_OK)
self.assertEqual(res.status_code, status.HTTP_200_OK)
# We can stream downloads
res = client.get("/api/projects/{}/tasks/{}/download/{}?_force_stream=1".format(project.id, task.id, list(task.ASSETS_MAP.keys())[0]))

@ -1 +1 @@
Subproject commit 2779f7337ef19aa9efbf44576a04887dd5a18762
Subproject commit 2a5d73ae2dfc89fc69f24095baebe31f0f0ac340

Wyświetl plik

@ -6,6 +6,7 @@ from django.utils import timezone
from django.dispatch import receiver
from guardian.models import GroupObjectPermissionBase
from guardian.models import UserObjectPermissionBase
from webodm import settings
import json
from pyodm import Node
@ -115,7 +116,15 @@ class ProcessingNode(models.Model):
opts = self.options_list_to_dict(options)
task = api_client.create_task(images, opts, name, progress_callback)
if not settings.TESTING:
task = api_client.create_task(images, opts, name, progress_callback)
else:
# The create_task function uses multi-threaded parallel uploads
# but Django tests cannot cope with DB updates from different threads
# (and progress_callback often updates the DB). So during testing
# we use the fallback function equivalent which is single-threaded
task = api_client.create_task_fallback(images, opts, name, progress_callback)
return task.uuid
def get_task_info(self, uuid, with_output=None):