Skip to content
Snippets Groups Projects
Commit edf40efa authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Test covers accessor output from segmentation pipeline

parent 10beaebd
No related branches found
No related tags found
No related merge requests found
...@@ -144,6 +144,7 @@ class TestApiFromAutomatedClient(TestServerTestCase): ...@@ -144,6 +144,7 @@ class TestApiFromAutomatedClient(TestServerTestCase):
}, },
).json() ).json()
# run segmentation pipeline on preloaded accessor
resp_infer = self._put( resp_infer = self._put(
f'pipelines/segment', f'pipelines/segment',
body={ body={
...@@ -156,6 +157,15 @@ class TestApiFromAutomatedClient(TestServerTestCase): ...@@ -156,6 +157,15 @@ class TestApiFromAutomatedClient(TestServerTestCase):
out_acc_id = resp_infer.json()['output_accessor_id'] out_acc_id = resp_infer.json()['output_accessor_id']
self.assertTrue(self._get(f'accessors/{out_acc_id}').json()['loaded']) self.assertTrue(self._get(f'accessors/{out_acc_id}').json()['loaded'])
# write and re-read output
filename = 'dummy_semantic_output.tif'
self._put(f'/accessors/write_to_file/{out_acc_id}', query={'filename': filename})
where_out = self._get('paths').json()['outbound_images']
fp_out = (Path(where_out) / filename)
self.assertTrue(fp_out.exists())
acc_out = generate_file_accessor(fp_out)
self.assertEqual(acc_out.shape_dict['C'], 1)
def test_restarting_session_clears_loaded_models(self): def test_restarting_session_clears_loaded_models(self):
resp_load = self._put(f'testing/models/dummy_semantic/load',) resp_load = self._put(f'testing/models/dummy_semantic/load',)
self.assertEqual(resp_load.status_code, 200, resp_load.json()) self.assertEqual(resp_load.status_code, 200, resp_load.json())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment