def test_delete_mars_keys(): logger.debug( os.environ.get('PYTEST_CURRENT_TEST').split(':')[-1].split(' ')[0]) config = conf().cleaner cleaner = Cleaner(config) date = datetime.datetime.now() - datetime.timedelta(days=1) # first put a few MARS keys put_key( config["url"], config["mars_path"] + "date=" + date.strftime(DATE_FORMAT) + "/aaaa") put_key( config["url"], config["mars_path"] + "date=" + date.strftime(DATE_FORMAT) + "/bbbb") put_key( config["url"], config["mars_path"] + "date=" + date.strftime(DATE_FORMAT) + "/cccc") # delete MARS keys n_deleted = cleaner.delete_keys(date) assert n_deleted == 3
def delete_dissemination_keys(date, destination): config = conf().cleaner cleaner = Cleaner(config) # delete dissemination keys return cleaner.delete_keys(date, destination)