Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'''
Contact: dmitry.zviagintsev@digitalglobe.com
Unit test the task registry class
'''
import os
from gbdxtools import Interface
from gbdxtools.task_registry import TaskRegistry
import vcr
from auth_mock import get_mock_gbdx_session
mock_gbdx_session = get_mock_gbdx_session(token="dummytoken")
gbdx = Interface(gbdx_connection=mock_gbdx_session)
def test_init():
tr = TaskRegistry()
assert isinstance(tr, TaskRegistry)
@vcr.use_cassette('tests/unit/cassettes/test_list_tasks.yaml', filter_headers=['authorization'])
def test_list_tasks():
tr = TaskRegistry()
task_list = tr.list()
assert task_list is not None
assert 'HelloGBDX' in task_list
@vcr.use_cassette('tests/unit/cassettes/test_describe_tasks.yaml', filter_headers=['authorization'])
def test_init():
gi = gbdxtools.Interface(gbdx_connection=mock_gbdx_session)
assert isinstance(gi, gbdxtools.Interface)
def test_init(self):
c = Catalog()
self.assertTrue(isinstance(c, Catalog))
def test_init(self):
c = Catalog()
self.assertTrue(isinstance(c, Catalog))
def test_init():
tr = TaskRegistry()
assert isinstance(tr, TaskRegistry)
def test_init():
tr = TaskRegistry()
assert isinstance(tr, TaskRegistry)
def test_init(self):
o = Ordering()
assert isinstance(o, Ordering)
def test_init(self):
o = Ordering()
assert isinstance(o, Ordering)
def test_init(self):
c = Idaho()
self.assertTrue(isinstance(c, Idaho))
def test_init(self):
c = Idaho()
self.assertTrue(isinstance(c, Idaho))