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(self):
c = Catalog()
self.assertTrue(isinstance(c, Catalog))
def test_init(self):
c = Catalog()
self.assertTrue(isinstance(c, Catalog))
def test_catalog_search_startDate_and_endDate_only_less_than_one_week_apart(self):
c = Catalog()
results = c.search(startDate='2008-01-01T00:00:00.000Z',
endDate='2008-01-03T00:00:00.000Z')
assert len(results) == 643
def test_catalog_get_data_location_catid_with_no_data(self):
c = Catalog()
s3path = c.get_data_location(catalog_id='1010010011AD6E00')
assert s3path == None
def test_catalog_search_wkt_and_startDate(self):
c = Catalog()
results = c.search(searchAreaWkt="POLYGON ((30.1 9.9, 30.1 10.1, 29.9 10.1, 29.9 9.9, 30.1 9.9))",
startDate='2012-01-01T00:00:00.000Z')
assert len(results) == 416
def test_catalog_get_data_location_Landsat(self):
c = Catalog()
s3path = c.get_data_location(catalog_id='LC81740532014364LGN00')
assert s3path == 's3://landsat-pds/L8/174/053/LC81740532014364LGN00'
def test_catalog_get_record_with_relationships(self):
"""
includeRelationships doesn't do anything anymore. This is now a test of backward compatibility.
"""
c = Catalog()
catid = '1040010019B4A600'
record = c.get(catid, includeRelationships=True)
self.assertEqual(record['identifier'], '1040010019B4A600')
assert 'DigitalGlobeAcquisition' in record['type']
def test_catalog_search_huge_aoi(self):
"""
Search an AOI the size of utah, broken into multiple smaller searches
"""
c = Catalog()
results = c.search(searchAreaWkt = "POLYGON((-113.88427734375 40.36642741921034,-110.28076171875 40.36642741921034,-110.28076171875 37.565262680889965,-113.88427734375 37.565262680889965,-113.88427734375 40.36642741921034))")
assert len(results) == 1000 # we will max out the paging limit of the vector service
def __init__(self, **kwargs):
interface = Auth(**kwargs)
self.gbdx_connection = interface.gbdx_connection
self.root_url = interface.root_url
self.logger = interface.logger
# create and store an instance of the GBDX s3 client
self.s3 = S3()
# create and store an instance of the GBDX Ordering Client
self.ordering = Ordering()
# create and store an instance of the GBDX Catalog Client
self.catalog = Catalog()
# create and store an instance of the GBDX Workflow Client
self.workflow = Workflow()
# create and store an instance of the Idaho Client
self.idaho = Idaho()
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
def __init__(self, **kwargs):
""" Construct the Idaho interface class.
Returns:
An instance of the Idaho interface class.
"""
interface = Auth(**kwargs)
self.base_url = '%s/catalog/v2' % interface.root_url
self.gbdx_connection = interface.gbdx_connection
self.catalog = Catalog()
self.logger = interface.logger