Added unit tests, updated docs

pull/600/head
Piero Toffanin 2019-01-15 09:26:24 -05:00
rodzic 3e5de5ad64
commit 534fa9d565
3 zmienionych plików z 17 dodań i 1 usunięć

Wyświetl plik

@ -355,6 +355,19 @@ class TestApi(BootTestCase):
# Verify max images field
self.assertTrue("max_images" in res.data)
# Verify odm version
self.assertTrue("odm_version" in res.data)
# label should be hostname:port (since no label is set)
self.assertEqual(res.data['label'], pnode.hostname + ":" + str(pnode.port))
# If we update the label, the label is used instead
pnode.label = "Test"
pnode.save()
res = client.get('/api/processingnodes/{}/'.format(pnode.id))
self.assertEqual(res.data['label'], "Test")
# Cannot delete a processing node as normal user
res = client.delete('/api/processingnodes/{}/'.format(pnode.id))
self.assertTrue(res.status_code, status.HTTP_403_FORBIDDEN)

Wyświetl plik

@ -18,6 +18,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='processingnode',
name='odm_version',
field=models.CharField(help_text='OpenDroneMap version used by the node.', max_length=32, null=True),
field=models.CharField(help_text='ODM version used by the node.', max_length=32, null=True),
),
]

Wyświetl plik

@ -12,6 +12,7 @@
"last_refreshed": "2017-03-01T21:14:49.918276Z",
"queue_count": 0,
"max_images": null,
"label": "nodeodm.masseranolabs.com:80",
"available_options": [
{
"help": "Oct-tree depth at which the Laplacian equation is solved in the surface reconstruction step. Increasing this value increases computation times slightly but helps reduce memory usage. Default: 9",
@ -33,9 +34,11 @@ online | bool | Whether the processing node could be reached in the last 5 minut
hostname | string | Hostname/IP address
port | int | Port
api_version | string | Version of NodeODM currently running
odm_version | string | Version of ODM currently being used
last_refreshed | string | Date and time this node was last seen online. This value is typically refreshed every 15-30 seconds and is used to decide whether a node is offline or not
queue_count | int | Number of [Task](#task) items currently being processed/queued on this node.
max_images | int | Optional maximum number of images this processing node can accept. null indicates no limit.
label | string | Label for the node
available_options | JSON[] | JSON-encoded list of options that this node is capable of handling. See [Available Options](#available-options) for more information