kopia lustrzana https://github.com/OpenDroneMap/WebODM
Add tests, bump version
rodzic
4c0b3b83f3
commit
bf24866cc8
|
@ -1083,7 +1083,10 @@ class Task(models.Model):
|
|||
|
||||
ept_dir = self.assets_path("entwine_pointcloud")
|
||||
try:
|
||||
tmp_ept_path = tempfile.mkdtemp('ept', dir=settings.MEDIA_TMP)
|
||||
if not os.path.exists(settings.MEDIA_TMP):
|
||||
os.makedirs(settings.MEDIA_TMP)
|
||||
|
||||
tmp_ept_path = tempfile.mkdtemp('_ept', dir=settings.MEDIA_TMP)
|
||||
params = [entwine, "build", "--threads", str(threads),
|
||||
"--tmp", quote(tmp_ept_path),
|
||||
"-i", quote(point_cloud),
|
||||
|
|
|
@ -408,6 +408,10 @@ class TestApiTask(BootTransactionTestCase):
|
|||
|
||||
# Can download raw assets
|
||||
res = client.get("/api/projects/{}/tasks/{}/assets/odm_orthophoto/odm_orthophoto.tif".format(project.id, task.id))
|
||||
self.assertTrue(res.status_code == status.HTTP_200_OK)
|
||||
|
||||
# EPT dataset should be there/have been created
|
||||
res = client.get("/api/projects/{}/tasks/{}/assets/entwine_pointcloud/ept.json".format(project.id, task.id))
|
||||
self.assertTrue(res.status_code == status.HTTP_200_OK)
|
||||
|
||||
# Orthophoto bands field should be populated
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
import time
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
import io
|
||||
import requests
|
||||
|
@ -64,14 +66,31 @@ class TestApiTask(BootTransactionTestCase):
|
|||
|
||||
self.assertEqual(task.status, status_codes.COMPLETED)
|
||||
|
||||
if not os.path.exists(settings.MEDIA_TMP):
|
||||
os.mkdir(settings.MEDIA_TMP)
|
||||
|
||||
# EPT assets should be there
|
||||
res = client.get("/api/projects/{}/tasks/{}/assets/entwine_pointcloud/ept.json".format(project.id, task.id))
|
||||
self.assertEqual(res.status_code, status.HTTP_200_OK)
|
||||
|
||||
# Try removing it
|
||||
shutil.rmtree(task.assets_path("entwine_pointcloud"))
|
||||
|
||||
res = client.get("/api/projects/{}/tasks/{}/assets/entwine_pointcloud/ept.json".format(project.id, task.id))
|
||||
self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)
|
||||
|
||||
# Rebuild it
|
||||
self.assertTrue(task.check_ept())
|
||||
|
||||
# EPT available again
|
||||
res = client.get("/api/projects/{}/tasks/{}/assets/entwine_pointcloud/ept.json".format(project.id, task.id))
|
||||
self.assertEqual(res.status_code, status.HTTP_200_OK)
|
||||
|
||||
# Download task assets
|
||||
task_uuid = task.uuid
|
||||
res = client.get("/api/projects/{}/tasks/{}/download/all.zip".format(project.id, task.id))
|
||||
self.assertEqual(res.status_code, status.HTTP_200_OK)
|
||||
|
||||
if not os.path.exists(settings.MEDIA_TMP):
|
||||
os.mkdir(settings.MEDIA_TMP)
|
||||
|
||||
assets_path = os.path.join(settings.MEDIA_TMP, "all.zip")
|
||||
|
||||
with open(assets_path, 'wb') as f:
|
||||
|
@ -318,3 +337,9 @@ class TestApiTask(BootTransactionTestCase):
|
|||
self.assertTrue(valid_cogeo(file_import_task.assets_path(task.ASSETS_MAP["orthophoto.tif"])))
|
||||
self.assertTrue(valid_cogeo(file_import_task.assets_path(task.ASSETS_MAP["dsm.tif"])))
|
||||
self.assertTrue(valid_cogeo(file_import_task.assets_path(task.ASSETS_MAP["dtm.tif"])))
|
||||
|
||||
def test_entwine_bin(self):
|
||||
entwine = shutil.which("entwine")
|
||||
self.assertTrue(entwine is not None)
|
||||
|
||||
self.assertEqual(subprocess.run([entwine, "--help"]).returncode, 0)
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "WebODM",
|
||||
"version": "2.9.2",
|
||||
"version": "2.9.3",
|
||||
"description": "User-friendly, extendable application and API for processing aerial imagery.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
Ładowanie…
Reference in New Issue