def check_dmid(prod_ls, contactid=None): # find all the submitted products that are nlaps and reject them not_avail = nlaps.products_are_nlaps(prod_ls) if not_avail: raise InventoryException(not_avail) token = inventory.get_cached_session() return inventory.get_cached_verify_scenes(token, prod_ls)
def check_dmid(prod_ls, contactid=None): try: token = inventory.get_cached_session() return inventory.check_valid(token, prod_ls) except Exception as e: msg = 'Could not connect to EarthExplorer source' logger.critical(msg + str(e)) raise InventoryConnectionException(msg)
def check_dmid(prod_ls, contactid=None): # find all the submitted products that are nlaps and reject them not_avail = nlaps.products_are_nlaps(prod_ls) if not_avail: raise InventoryException(not_avail) logger.info('@@ VERIFY: FETCH via MACHINE-TO-MACHINE') token = inventory.get_cached_session() results = inventory.get_cached_verify_scenes(token, prod_ls) logger.info('@@ VERIFY: COMPLETE via MACHINE-TO-MACHINE') return results
def setUp(self): os.environ['espa_api_testing'] = 'True' self.token = inventory.get_cached_session() # Initial "real" request self.collection_ids = [ 'LC08_L1TP_156063_20170207_20170216_01_T1', 'LE07_L1TP_028028_20130510_20160908_01_T1', 'LT05_L1TP_032028_20120425_20160830_01_T1' ] _ = inventory.get_cached_convert(self.token, self.collection_ids) _ = inventory.get_cached_verify_scenes(self.token, self.collection_ids)
def test_cached_login(self): token = inventory.get_cached_session() self.assertIsInstance(token, basestring)
def check_dmid(prod_ls, contactid=None): token = inventory.get_cached_session() return inventory.check_valid(token, prod_ls)