Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_init():
tr = TaskRegistry()
assert isinstance(tr, TaskRegistry)
def test_init():
tr = TaskRegistry()
assert isinstance(tr, TaskRegistry)
def test_update_task_definition():
# Note that this test requires the task to be registered all ready.
# If updating the VCR yaml cassette, manually register the gbdxtools-test-task above,
# Deleting it once the VCR cassette has been created.
tr = TaskRegistry()
updated_task = _task_json()
output_ports = updated_task['outputPortDescriptors']
updated_task['outputPortDescriptors'] = output_ports + [{"name": "output%s" % len(output_ports), "type": "string"}]
task_name = '%s:%s' % (updated_task['name'], updated_task['version'])
r = tr.update(task_name, updated_task)
assert r['outputPortDescriptors'] == updated_task['outputPortDescriptors']
def test_list_tasks():
tr = TaskRegistry()
task_list = tr.list()
assert task_list is not None
assert 'HelloGBDX' in task_list
def _test_register_task(task_json=None, filename=None):
tr = TaskRegistry()
if task_json:
rv = tr.register(task_json)
else:
rv = tr.register(filename)
assert 'successfully registered' in rv.lower()
def test_register_fails_when_both_json_and_file():
tr = TaskRegistry()
try:
tr.register(task_json={'any': 'thing'}, json_filename="any")
except Exception as e:
if "Both task json and filename can't be provided." in str(e):
pass
else:
raise
self.idaho_image = IdahoImage
self.landsat_image = LandsatImage
self.modis = Modis
self.sentinel1 = Sentinel1
self.sentinel2 = Sentinel2
self.tms_image = TmsImage
self.dem_image = DemImage
self.wv03_vnir = WV03_VNIR
self.wv03_swir = WV03_SWIR
self.wv02 = WV02
self.wv04 = WV04
self.ge01 = GE01
self.s3_image = S3Image
self.rda_template_image = RDATemplateImage
self.task_registry = TaskRegistry()
self.vectors = Vectors()
self.catalog_image = CatalogImage
self.idaho_image = IdahoImage
self.landsat_image = LandsatImage
self.sentinel2 = Sentinel2
self.tms_image = TmsImage
self.dem_image = DemImage
self.wv03_vnir = WV03_VNIR
self.wv02 = WV02
self.ge01 = GE01
self.s3_image = S3Image
self.graph_image = GraphImage
self.task_registry = TaskRegistry()