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

Option to copy file from test server's get_accessor method

parent 4d28155b
No related branches found
No related tags found
No related merge requests found
......@@ -131,11 +131,12 @@ class TestServerBaseClass(unittest.TestCase):
)
return self.input_data['name']
def get_accessor(self, accessor_id, filename=None):
def get_accessor(self, accessor_id, filename=None, copy_to=None):
r = self.assertPutSuccess(f'/accessors/write_to_file/{accessor_id}', query={'filename': filename})
where_out = self.assertGetSuccess('paths')['outbound_images']
fp_out = (Path(where_out) / r)
fp_out = Path(self.assertGetSuccess('paths')['outbound_images']) / r
self.assertTrue(fp_out.exists())
if copy_to:
copyfile(fp_out, Path(copy_to) / f'normal_{fp_out.name}')
return generate_file_accessor(fp_out)
......
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