How to use the gbdxtools.task_registry.TaskRegistry function in gbdxtools

To help you get started, we’ve selected a few gbdxtools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DigitalGlobe / gbdxtools / tests / unit / test_task_registry.py View on Github external
def test_init():
    tr = TaskRegistry()
    assert isinstance(tr, TaskRegistry)
github DigitalGlobe / gbdxtools / tests / unit / test_task_registry.py View on Github external
def test_init():
    tr = TaskRegistry()
    assert isinstance(tr, TaskRegistry)
github DigitalGlobe / gbdxtools / tests / unit / test_task_registry.py View on Github external
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']
github DigitalGlobe / gbdxtools / tests / unit / test_task_registry.py View on Github external
def test_list_tasks():
    tr = TaskRegistry()
    task_list = tr.list()
    assert task_list is not None
    assert 'HelloGBDX' in task_list
github DigitalGlobe / gbdxtools / tests / unit / test_task_registry.py View on Github external
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()
github DigitalGlobe / gbdxtools / tests / unit / test_task_registry.py View on Github external
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
github DigitalGlobe / gbdxtools / gbdxtools / interface.py View on Github external
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()
github DigitalGlobe / gbdxtools / gbdxtools / interface.py View on Github external
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()