diff --git a/src/actinia_core/cli/actinia_server.py b/src/actinia_core/cli/actinia_server.py index 49bf3a047..2bde42e9d 100755 --- a/src/actinia_core/cli/actinia_server.py +++ b/src/actinia_core/cli/actinia_server.py @@ -45,7 +45,6 @@ def main(): - parser = argparse.ArgumentParser( description="Start actinia server. A running redis server" + " is required." diff --git a/src/actinia_core/cli/actinia_user.py b/src/actinia_core/cli/actinia_user.py index ac7b88df7..4ff6e73f9 100755 --- a/src/actinia_core/cli/actinia_user.py +++ b/src/actinia_core/cli/actinia_user.py @@ -287,7 +287,6 @@ def main(): # CREATE ############################ if args.action == "create": - if args.user_id is None: sys.stderr.write("You need to provide a user id\n") return @@ -333,7 +332,6 @@ def main(): or args.action == "update_rm" or args.action == "update_rm_location" ): - if args.user_id is None: sys.stderr.write("You need to provide a user id\n") return @@ -362,7 +360,6 @@ def main(): # DELETE ############################ elif args.action == "delete": - user = ActiniaUser(args.user_id) if user.exists() == 1: @@ -377,7 +374,6 @@ def main(): # SHOW ############################## elif args.action == "show": - user = ActiniaUser(args.user_id) if user.exists() == 1: @@ -387,13 +383,11 @@ def main(): # LIST ############################## elif args.action == "list": - user = ActiniaUser(args.user_id) pprint.pprint(user.list_all_users()) # PWCHECK ########################### elif args.action == "pwcheck": - if args.user_id is None: sys.stderr.write("You need to provide a user id\n") return diff --git a/src/actinia_core/cli/rq_custom_worker.py b/src/actinia_core/cli/rq_custom_worker.py index e6c558eb1..7ae07396c 100755 --- a/src/actinia_core/cli/rq_custom_worker.py +++ b/src/actinia_core/cli/rq_custom_worker.py @@ -123,7 +123,6 @@ def main(): password=conf.REDIS_QUEUE_SERVER_PASSWORD, ) ): - logger = logging.getLogger("rq.worker") logger.setLevel(logging.ERROR) diff --git a/src/actinia_core/cli/webhook_server.py b/src/actinia_core/cli/webhook_server.py index bcb692a2e..e7c5311f1 100644 --- a/src/actinia_core/cli/webhook_server.py +++ b/src/actinia_core/cli/webhook_server.py @@ -44,7 +44,6 @@ @flask_app.route("/webhook/finished", methods=["GET", "POST"]) def finished(): - try: pprint(json.loads(request.get_json())) except BadRequest: @@ -88,7 +87,6 @@ def shutdown(): def main(): - parser = argparse.ArgumentParser( description="Start a REST webhook server that exposes a GET/POST " "endpoint which returns HTTP code 200 if called. The endpoints are: " diff --git a/src/actinia_core/cli/webhook_server_broken.py b/src/actinia_core/cli/webhook_server_broken.py index e28aedf88..d8226a54a 100644 --- a/src/actinia_core/cli/webhook_server_broken.py +++ b/src/actinia_core/cli/webhook_server_broken.py @@ -90,7 +90,6 @@ def shutdown(): def main(): - parser = argparse.ArgumentParser( description="Start a webhook server that exposes GET/POST endpoints " "which returns HTTP code 200 if called. The endpoints are: " diff --git a/src/actinia_core/core/common/aws_sentinel_interface.py b/src/actinia_core/core/common/aws_sentinel_interface.py index e7f7bd91a..07925d61c 100644 --- a/src/actinia_core/core/common/aws_sentinel_interface.py +++ b/src/actinia_core/core/common/aws_sentinel_interface.py @@ -182,7 +182,6 @@ def get_sentinel_urls(self, product_ids, bands=None): bands = ["B04", "B08"] try: - for band in bands: if band not in self.sentinel_bands: raise Exception("Unknown Sentinel-2 band name <%s>" % band) diff --git a/src/actinia_core/core/common/google_satellite_bigquery_interface.py b/src/actinia_core/core/common/google_satellite_bigquery_interface.py index 90d3301d7..ca4ec8818 100644 --- a/src/actinia_core/core/common/google_satellite_bigquery_interface.py +++ b/src/actinia_core/core/common/google_satellite_bigquery_interface.py @@ -383,7 +383,6 @@ def _query_satellite_archive( ] """ try: - self._start_clients() scene_id_query = None spacecraft_id_query = None @@ -572,7 +571,6 @@ def get_landsat_urls(self, scene_ids, bands=None): bands = ["B1", "B2"] try: - self._start_clients() for scene_id in scene_ids: @@ -595,7 +593,6 @@ def get_landsat_urls(self, scene_ids, bands=None): if query_results.result(): for row in query_results.result(): - scene_id, sensing_time, base_url = row public_url = self.gcs_url + base_url[5:] sensor_id = extract_sensor_id_from_scene_id(scene_id) @@ -772,7 +769,6 @@ def get_sentinel_urls(self, product_ids, bands=None): bands = ["B04", "B08"] try: - self._start_clients() for band in bands: @@ -793,7 +789,6 @@ def get_sentinel_urls(self, product_ids, bands=None): if rows: for row in rows: - ( granule_id, product_id, diff --git a/src/actinia_core/core/common/landsat_processing_library.py b/src/actinia_core/core/common/landsat_processing_library.py index 17f652a62..2d81f42af 100644 --- a/src/actinia_core/core/common/landsat_processing_library.py +++ b/src/actinia_core/core/common/landsat_processing_library.py @@ -209,7 +209,6 @@ def datetime_to_grass_datetime_string(dt): # Check for time zone info in the datetime object if dt.tzinfo is not None: - tz = dt.tzinfo.utcoffset(0) if tz.seconds > 86400 / 2: tz = (tz.seconds - 86400) / 60 @@ -319,7 +318,6 @@ def _setup(self): count += 1 def get_import_process_list(self): - count = 0 import_commands = [] @@ -342,7 +340,6 @@ def get_import_process_list(self): return import_commands def get_i_landsat_toar_process_list(self, atcor_method): - option = "uncorrected" if atcor_method == "DOS4": @@ -374,7 +371,6 @@ def get_i_landsat_toar_process_list(self, atcor_method): return toar_commands def get_i_vi_process_list(self, atcor_method, processing_method): - self.ndvi_name = "%s_%s_%s" % ( self.scene_id, atcor_method, diff --git a/src/actinia_core/core/common/process_chain.py b/src/actinia_core/core/common/process_chain.py index b8b4f7180..82de2ac71 100644 --- a/src/actinia_core/core/common/process_chain.py +++ b/src/actinia_core/core/common/process_chain.py @@ -145,7 +145,6 @@ def __init__( self.webhook_auth = None def process_chain_to_process_list(self, process_chain): - if not process_chain: raise AsyncProcessError("Process chain is empty") @@ -188,7 +187,6 @@ def _process_chain_to_process_list(self, process_chain): # Check for the webhooks if "webhooks" in process_chain: - if "finished" in process_chain["webhooks"]: self.webhook_finished = process_chain["webhooks"]["finished"] self._check_if_webhook_exists( @@ -206,7 +204,6 @@ def _process_chain_to_process_list(self, process_chain): ) for process_descr in process_chain["list"]: - if "module" in process_descr: module = self._create_module_process(process_descr) if module: @@ -768,7 +765,6 @@ def _create_exec_process(self, module_descr): if "params" in module_descr: for search_string in module_descr["params"]: - # Search for file identifiers and generate the temporary file # path if "$file" in search_string and "::" in search_string: @@ -833,7 +829,6 @@ def _create_download_process_list(self): or entry["import_descr"]["type"].lower() == "vector" or entry["import_descr"]["type"].lower() == "file" ): - rvf_downimport_commands = ( self._get_raster_vector_file_download_import_command(entry) ) @@ -930,7 +925,6 @@ def _create_module_process_legacy(self, id, module_descr): if "inputs" in module_descr: for key in module_descr["inputs"]: - search_string = str(module_descr["inputs"][key]) # Search for file identifiers and generate the temporary file @@ -949,7 +943,6 @@ def _create_module_process_legacy(self, id, module_descr): # Check for mapset in input name and append it # to the list of required mapsets if "@" in str(module_descr["inputs"][key]): - # Mapset names are after an @ symbol # Mapsets in expressions can be detected by replacing # the symbols like *, +, :, /, {, (,},], ... by spaces @@ -997,7 +990,6 @@ def _create_module_process_legacy(self, id, module_descr): if "outputs" in module_descr: for key in module_descr["outputs"]: if "name" in module_descr["outputs"][key]: - search_string = module_descr["outputs"][key]["name"] # Search for file identifiers and generate the temporary @@ -1129,7 +1121,6 @@ def _create_exec_process_legacy(self, id, module_descr): executable = module_descr["executable"] if "parameters" in module_descr: for search_string in module_descr["parameters"]: - # Search for file identifiers and generate the temporary file # path if "$file" in search_string and "::" in search_string: diff --git a/src/actinia_core/core/common/process_queue.py b/src/actinia_core/core/common/process_queue.py index ddaff3ef4..29affd7c6 100644 --- a/src/actinia_core/core/common/process_queue.py +++ b/src/actinia_core/core/common/process_queue.py @@ -161,7 +161,6 @@ class EnqueuedProcess(object): """ def __init__(self, func, timeout, resource_logger, args): - self.process = Process(target=func, args=args) self.timeout = timeout self.config = args[0].config @@ -242,7 +241,6 @@ def check_exit(self): """ if self.process.exitcode is not None and self.process.exitcode != 0: - # Check if the process noticed the error already response_data = self.resource_logger.get( self.user_id, self.resource_id, self.iteration diff --git a/src/actinia_core/core/common/redis_interface.py b/src/actinia_core/core/common/redis_interface.py index 01ccc5b64..f77e248a7 100644 --- a/src/actinia_core/core/common/redis_interface.py +++ b/src/actinia_core/core/common/redis_interface.py @@ -116,7 +116,7 @@ def __enqueue_job_redis(queue, timeout, func, *args): *args, job_timeout=timeout, ttl=global_config.REDIS_QUEUE_JOB_TTL, - result_ttl=global_config.REDIS_QUEUE_JOB_TTL + result_ttl=global_config.REDIS_QUEUE_JOB_TTL, ) log.info(ret) diff --git a/src/actinia_core/core/common/sentinel_processing_library.py b/src/actinia_core/core/common/sentinel_processing_library.py index 18c02effb..c999f2871 100644 --- a/src/actinia_core/core/common/sentinel_processing_library.py +++ b/src/actinia_core/core/common/sentinel_processing_library.py @@ -64,7 +64,6 @@ def datetime_to_grass_datetime_string(dt): # Check for time zone info in the datetime object if dt.tzinfo is not None: - tz = dt.tzinfo.utcoffset(0) if tz.seconds > 86400 / 2: tz = (tz.seconds - 86400) / 60 @@ -260,7 +259,6 @@ def _setup_download_import_google(self): # Create file names, urls and check the download cache for band in self.bands: - file_name = self.query_result[self.product_id][band]["file"] tile_name = self.query_result[self.product_id][band]["tile"] public_url = self.query_result[self.product_id][band]["public_url"] @@ -380,7 +378,6 @@ def _setup_download_import_aws(self): # Create file names, urls and check the download cache for band in self.bands: - file_name = self.query_result[self.product_id][band]["file"] tile_name = self.query_result[self.product_id][band]["tile"] public_url = self.query_result[self.product_id][band]["public_url"] diff --git a/src/actinia_core/core/common/user.py b/src/actinia_core/core/common/user.py index b0b33feb9..fe0628f27 100644 --- a/src/actinia_core/core/common/user.py +++ b/src/actinia_core/core/common/user.py @@ -52,7 +52,6 @@ class ActiniaUser(ActiniaUserBase): db = redis_user_interface def read_from_db(self): - creds = self.db.get_credentials(self.user_id) self.user_role = self.get_role() self.user_group = self.get_group() diff --git a/src/actinia_core/core/geodata_download_importer.py b/src/actinia_core/core/geodata_download_importer.py index e5c479c73..36f59fd54 100644 --- a/src/actinia_core/core/geodata_download_importer.py +++ b/src/actinia_core/core/geodata_download_importer.py @@ -214,7 +214,6 @@ def get_download_process_list(self): # Download file only if it does not exist in the download cache if os.path.isfile(dest) is False: - p = get_wget_process(source, url) download_commands.append(p) if source != dest: diff --git a/src/actinia_core/core/grass_init.py b/src/actinia_core/core/grass_init.py index cbf86d8b0..d2beec94f 100644 --- a/src/actinia_core/core/grass_init.py +++ b/src/actinia_core/core/grass_init.py @@ -87,7 +87,6 @@ class GrassEnvironment(ProcessLogging): """This class saves and sets grass environment variables""" def __init__(self): - ProcessLogging.__init__(self) self.env = { "GISBASE": "", @@ -301,7 +300,6 @@ def getFileName(self): class GrassModuleRunner(ProcessLogging): def __init__(self, grassbase, grass_addon_path): - ProcessLogging.__init__(self) self.grassbase = grassbase diff --git a/src/actinia_core/core/list_grass_modules.py b/src/actinia_core/core/list_grass_modules.py index b76179385..f2e8337bb 100644 --- a/src/actinia_core/core/list_grass_modules.py +++ b/src/actinia_core/core/list_grass_modules.py @@ -51,7 +51,6 @@ class GrassModuleReader(object): """ def __init__(self, filename): - self.modules_keyword_dict = {} file = QFile(filename) @@ -74,13 +73,11 @@ def get(self): return self.modules_keyword_dict def parse_module(self): - module = None keywords = None description = None while self.xml.readNextStartElement(): - if self.xml.name() == "module": module = self.xml.readElementText() elif self.xml.name() == "description": @@ -126,7 +123,6 @@ def test(): def main(): - grass_modules_xml_path = global_config.GRASS_MODULES_XML_PATH module_reader = GrassModuleReader(grass_modules_xml_path) diff --git a/src/actinia_core/core/messages_logger.py b/src/actinia_core/core/messages_logger.py index d04027d74..e0abf5b79 100644 --- a/src/actinia_core/core/messages_logger.py +++ b/src/actinia_core/core/messages_logger.py @@ -45,7 +45,6 @@ def __init__(self, config=None, user_id=None, fluent_sender=None): ) def _log_message(self, log_level, message): - node = platform.node() ctime = time.ctime() diff --git a/src/actinia_core/core/redis_api_log.py b/src/actinia_core/core/redis_api_log.py index d51496196..ef525917f 100644 --- a/src/actinia_core/core/redis_api_log.py +++ b/src/actinia_core/core/redis_api_log.py @@ -73,7 +73,8 @@ def __init__(self): """ def add(self, user_id, log_entry): - """Add a API log entry to a user specific API log list in the Redis server + """Add a API log entry to a user specific API log list in the Redis + server Args: user_id (str): The user id of the API log @@ -154,7 +155,6 @@ def delete(self, user_id): def test_api_logging(r): - user_id = "abcdefg" # Remove the loglist diff --git a/src/actinia_core/core/redis_fluentd_logger_base.py b/src/actinia_core/core/redis_fluentd_logger_base.py index ff9282bbb..d7fda3350 100644 --- a/src/actinia_core/core/redis_fluentd_logger_base.py +++ b/src/actinia_core/core/redis_fluentd_logger_base.py @@ -45,7 +45,6 @@ class RedisFluentLoggerBase(object): """Base class for all logger that use Redis and fluentd for logging""" def __init__(self, config=None, user_id=None, fluent_sender=None): - if config is None: config = global_config if user_id is None: @@ -65,7 +64,6 @@ def __init__(self, config=None, user_id=None, fluent_sender=None): ) def _send_to_fluent(self, tag, data): - try: cur_time = int(time.time()) self.fluent_sender.emit_with_time( @@ -94,7 +92,6 @@ def _send_to_fluent(self, tag, data): ) def _send_to_logging_interface(self, tag, data): - if tag == "RESOURCE_LOG" and "status" in data: if data["status"] == "error": log.error(data) @@ -115,7 +112,6 @@ def _send_to_logging_interface(self, tag, data): log.info(data) def send_to_logger(self, tag, data): - if global_config.LOG_INTERFACE == "fluentd": self._send_to_fluent(tag, data) diff --git a/src/actinia_core/core/redis_lock.py b/src/actinia_core/core/redis_lock.py index 792db91aa..1a1c88992 100644 --- a/src/actinia_core/core/redis_lock.py +++ b/src/actinia_core/core/redis_lock.py @@ -236,7 +236,6 @@ def unlock(self, resource_id): def test_locking(r): - resource = "location/mapset" # Remove the lock if its present diff --git a/src/actinia_core/core/redis_resources.py b/src/actinia_core/core/redis_resources.py index 64c896c70..14f452a75 100644 --- a/src/actinia_core/core/redis_resources.py +++ b/src/actinia_core/core/redis_resources.py @@ -269,7 +269,6 @@ def delete_termination(self, resource_id): def test_resource_entries(r): - resource_id = "abcdefg" # Remove the resource entry if it exist diff --git a/src/actinia_core/core/redis_user.py b/src/actinia_core/core/redis_user.py index 5ecb26e1a..e5740910b 100644 --- a/src/actinia_core/core/redis_user.py +++ b/src/actinia_core/core/redis_user.py @@ -313,7 +313,6 @@ def list_all_ids(self): def test_management(r): - user_id = "Soeren" user_group = "test_1" password_hash = "hash" diff --git a/src/actinia_core/core/stac_exporter_interface.py b/src/actinia_core/core/stac_exporter_interface.py index f19bd3f59..daec49ad6 100644 --- a/src/actinia_core/core/stac_exporter_interface.py +++ b/src/actinia_core/core/stac_exporter_interface.py @@ -78,7 +78,6 @@ def stac_builder(self, resource_url: str, filename: str, output_type: str): self._stac_collection_initializer() if output_type == "raster": - # Get parameters for STAC item extra_values = self._get_raster_parameters(output_path) @@ -126,7 +125,6 @@ def stac_builder(self, resource_url: str, filename: str, output_type: str): redis_items = self._save_items_redis(item, item_name) if redis_items: - # Add item to Catalog catalog.add_item(item) @@ -254,7 +252,6 @@ def bbox(coord_list): @staticmethod def _update_catalog_redis(catalog): - new_catalog = catalog.to_dict() redis_actinia_interface.update("result-catalog", new_catalog) diff --git a/src/actinia_core/core/stac_importer_interface.py b/src/actinia_core/core/stac_importer_interface.py index 19511cfba..75f103549 100644 --- a/src/actinia_core/core/stac_importer_interface.py +++ b/src/actinia_core/core/stac_importer_interface.py @@ -54,11 +54,10 @@ class STACImporter: @staticmethod def _get_search_root(stac_collection_id): - stac_from_actinia = callStacCollection(stac_collection_id) try: stac_json = json.loads(stac_from_actinia) - except (Exception): + except Exception: stac_json = stac_from_actinia for item in stac_json["links"]: @@ -77,7 +76,6 @@ def _get_search_root(stac_collection_id): @staticmethod def _apply_filter(stac_root_search, stac_name, interval, bbox, filter): - search_body = { "collections": [stac_name], } @@ -104,7 +102,6 @@ def _apply_filter(stac_root_search, stac_name, interval, bbox, filter): "features" in full_filtered_result and len(full_filtered_result["features"]) > 0 ): - return full_filtered_result else: raise AsyncProcessError("Not matched found") @@ -143,7 +140,6 @@ def _stac_import( filter=None, strd_name=None, ): - if has_plugin: try: stac_name = stac_collection_id.split(".")[3] @@ -258,7 +254,6 @@ def get_stac_import_download_commands( message_logger=None, send_resource_update=None, ): - """Helper method to get the stac import and download commands. Args: stac_entry (dict): stac_entry of the import description list diff --git a/src/actinia_core/core/storage_interface_aws_s3.py b/src/actinia_core/core/storage_interface_aws_s3.py index 93a06ce44..a236bdd31 100644 --- a/src/actinia_core/core/storage_interface_aws_s3.py +++ b/src/actinia_core/core/storage_interface_aws_s3.py @@ -65,7 +65,8 @@ def setup(self): self.s3_client = self.session.client("s3") def get_resource_urls(self): - """Return all resource urls that were generated when storing a resource on disk + """Return all resource urls that were generated when storing a resource + on disk Returns: (list): A list of urls diff --git a/src/actinia_core/core/storage_interface_base.py b/src/actinia_core/core/storage_interface_base.py index c18b2d54e..f0363ba83 100644 --- a/src/actinia_core/core/storage_interface_base.py +++ b/src/actinia_core/core/storage_interface_base.py @@ -62,7 +62,8 @@ def setup(self): @abstractmethod def get_resource_urls(self): - """Return all resource urls that were generated when storing a resource on disk + """Return all resource urls that were generated when storing a resource + on disk Returns: (list): A list of urls @@ -72,8 +73,8 @@ def get_resource_urls(self): @abstractmethod def store_resource(self, file_path): - """Store a resource (file) at the user resource storage and return an URL - to the resource accessible via HTTP + """Store a resource (file) at the user resource storage and return an + URL to the resource accessible via HTTP Args: file_path: diff --git a/src/actinia_core/core/utils.py b/src/actinia_core/core/utils.py index 068a35161..48bc75673 100644 --- a/src/actinia_core/core/utils.py +++ b/src/actinia_core/core/utils.py @@ -94,9 +94,9 @@ def path_is_in_allowed_read_and_write_paths(path): def path_is_in_allowed_read_paths(path): - """Checks whether the passed path is a valid read path, uses the global_config - variables `GRASS_USER_DATABASE`, `GRASS_DATABASE` and `GRASS_RESOURCE_DIR` - for the check. + """Checks whether the passed path is a valid read path, uses the + global_config variables `GRASS_USER_DATABASE`, `GRASS_DATABASE` and + `GRASS_RESOURCE_DIR` for the check. Args: path (string): a normalized path @@ -113,8 +113,9 @@ def path_is_in_allowed_read_paths(path): def path_is_in_allowed_write_paths(path): - """Checks whether the passed path is a valid write path, uses the global_config - variables `GRASS_USER_DATABASE` and `GRASS_RESOURCE_DIR` for the check. + """Checks whether the passed path is a valid write path, uses the + global_config variables `GRASS_USER_DATABASE` and `GRASS_RESOURCE_DIR` for + the check. Args: path (string): a normalized path diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/download_cache_management.py b/src/actinia_core/processing/actinia_processing/ephemeral/download_cache_management.py index c84e0c79f..be0ba5534 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/download_cache_management.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/download_cache_management.py @@ -57,13 +57,11 @@ def __init__(self, *args): self.response_model_class = StorageResponseModel def _execute(self): - self._setup() if os.path.exists(self.user_download_cache_path) and os.path.isdir( self.user_download_cache_path ): - executable = "/usr/bin/du" args = ["-sb", self.user_download_cache_path] diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/ephemeral_processing_with_export.py b/src/actinia_core/processing/actinia_processing/ephemeral/ephemeral_processing_with_export.py index 6da06ad5c..258d3893d 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/ephemeral_processing_with_export.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/ephemeral_processing_with_export.py @@ -104,7 +104,6 @@ def _export_raster( file_name = raster_name.split("@")[0] + suffix if use_raster_region is True: - p = Process( exec_type="grass", executable="g.region", @@ -411,7 +410,6 @@ def _export_resources(self, use_raster_region=False): """ for resource in self.resource_export_list: - # Check for termination requests between the exports if ( bool( @@ -432,7 +430,6 @@ def _export_resources(self, use_raster_region=False): "file", "strds", ]: - output_type = resource["export"]["type"] output_path = None diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/persistent_processing.py b/src/actinia_core/processing/actinia_processing/ephemeral/persistent_processing.py index 9bb9d971d..bb510c9bf 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/persistent_processing.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/persistent_processing.py @@ -209,7 +209,6 @@ def _check_mapset(self, mapset): and os.access(self.user_location_path, os.R_OK | os.X_OK | os.W_OK) is True ): - self.orig_mapset_path = os.path.join( self.user_location_path, mapset ) diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/process_validation.py b/src/actinia_core/processing/actinia_processing/ephemeral/process_validation.py index 7c9bb76fe..df19463e3 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/process_validation.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/process_validation.py @@ -43,7 +43,6 @@ def __init__(self, *args): EphemeralProcessing.__init__(self, *args) def _execute(self): - self._setup() process_chain = ( diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/raster_colors.py b/src/actinia_core/processing/actinia_processing/ephemeral/raster_colors.py index 75b84ef1b..257127fa8 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/raster_colors.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/raster_colors.py @@ -45,7 +45,6 @@ def __init__(self, *args): EphemeralProcessing.__init__(self, *args) def _execute(self, skip_permission_check=True): - self._setup() raster_name = self.map_name diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/raster_layer.py b/src/actinia_core/processing/actinia_processing/ephemeral/raster_layer.py index d6f9d8860..6ad13bd2f 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/raster_layer.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/raster_layer.py @@ -42,7 +42,6 @@ class EphemeralRasterInfo(EphemeralProcessing): def __init__(self, *args): - EphemeralProcessing.__init__(self, *args) def _execute(self): diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/raster_legend.py b/src/actinia_core/processing/actinia_processing/ephemeral/raster_legend.py index acf3d0bd9..01af876b5 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/raster_legend.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/raster_legend.py @@ -41,7 +41,6 @@ class EphemeralRasterLegend(EphemeralProcessing): def __init__(self, *args): - EphemeralProcessing.__init__(self, *args) def _execute(self, skip_permission_check=True): diff --git a/src/actinia_core/processing/actinia_processing/ephemeral/resource_storage_management.py b/src/actinia_core/processing/actinia_processing/ephemeral/resource_storage_management.py index 6f1c65156..722e94cb0 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral/resource_storage_management.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral/resource_storage_management.py @@ -57,13 +57,11 @@ def __init__(self, *args): ) def _execute(self): - self._setup() if os.path.exists(self.user_resource_storage_path) and os.path.isdir( self.user_resource_storage_path ): - executable = "/usr/bin/du" args = ["-sb", self.user_resource_storage_path] diff --git a/src/actinia_core/processing/actinia_processing/ephemeral_processing.py b/src/actinia_core/processing/actinia_processing/ephemeral_processing.py index 7180afa7c..292d06495 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral_processing.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral_processing.py @@ -1104,7 +1104,6 @@ def _create_temporary_mapset( # if interim_result_mapset is set copy the mapset from the interim # results if interim_result_mapset: - self.message_logger.info( "Rsync interim result mapset to temporary GRASS DB" ) diff --git a/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/raster_renderer.py b/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/raster_renderer.py index 2788f10d9..519da57db 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/raster_renderer.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/raster_renderer.py @@ -95,7 +95,6 @@ def _execute(self, skip_permission_check=True): class EphemeralRasterRGBRenderer(EphemeralRendererBase): def __init__(self, *args): - EphemeralProcessing.__init__(self, *args) def _execute(self, skip_permission_check=True): diff --git a/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/strds_renderer.py b/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/strds_renderer.py index 14801f509..c7bb9f74c 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/strds_renderer.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/strds_renderer.py @@ -42,7 +42,6 @@ class EphemeralSTRDSRenderer(EphemeralRendererBase): def __init__(self, *args): - EphemeralProcessing.__init__(self, *args) def _execute(self, skip_permission_check=True): diff --git a/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/vector_renderer.py b/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/vector_renderer.py index 1b75b8c7e..ebbc79296 100644 --- a/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/vector_renderer.py +++ b/src/actinia_core/processing/actinia_processing/ephemeral_renderer_base/vector_renderer.py @@ -44,7 +44,6 @@ class EphemeralVectorRenderer(EphemeralRendererBase): def __init__(self, *args): - EphemeralProcessing.__init__(self, *args) def _execute(self, skip_permission_check=True): diff --git a/src/actinia_core/processing/actinia_processing/persistent/download_cache_management.py b/src/actinia_core/processing/actinia_processing/persistent/download_cache_management.py index 454bbc7f8..08f9b0f6c 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/download_cache_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/download_cache_management.py @@ -46,14 +46,12 @@ class DownloadCacheDelete(PersistentProcessing): """Delete the whole download cache directory""" def __init__(self, *args): - PersistentProcessing.__init__(self, *args) self.user_download_cache_path = os.path.join( self.config.DOWNLOAD_CACHE, self.user_id ) def _execute(self): - self._setup() if os.path.exists(self.user_download_cache_path) and os.path.isdir( diff --git a/src/actinia_core/processing/actinia_processing/persistent/location_management.py b/src/actinia_core/processing/actinia_processing/persistent/location_management.py index 26e0e4eab..d39ba1ba2 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/location_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/location_management.py @@ -49,7 +49,6 @@ def __init__(self, *args): PersistentProcessing.__init__(self, *args) def _execute(self): - new_location = self.location_name self.location_name = self.config.GRASS_DEFAULT_LOCATION diff --git a/src/actinia_core/processing/actinia_processing/persistent/map_layer_management.py b/src/actinia_core/processing/actinia_processing/persistent/map_layer_management.py index 521e109b9..5d23d0360 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/map_layer_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/map_layer_management.py @@ -51,7 +51,6 @@ def __init__(self, *args): self.response_model_class = StringListProcessingResultResponseModel def _execute(self): - self._setup() args, layer_type = self.data @@ -92,11 +91,9 @@ class PersistentRemoveLayers(PersistentProcessing): """Remove layers in a mapset""" def __init__(self, *args): - PersistentProcessing.__init__(self, *args) def _execute(self): - self._setup() args, layer_type = self.data @@ -134,11 +131,9 @@ class PersistentRenameLayers(PersistentProcessing): """Rename raster layers in a mapset""" def __init__(self, *args): - PersistentProcessing.__init__(self, *args) def _execute(self): - self._setup() args, layer_type = self.data diff --git a/src/actinia_core/processing/actinia_processing/persistent/mapset_management.py b/src/actinia_core/processing/actinia_processing/persistent/mapset_management.py index 08a4531b5..3e3e6ab8c 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/mapset_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/mapset_management.py @@ -119,7 +119,6 @@ def __init__(self, *args): self.response_model_class = MapsetInfoResponseModel def _execute(self): - self._setup() pc = { @@ -169,7 +168,6 @@ def __init__(self, *args): PersistentProcessing.__init__(self, *args) def _execute(self): - self._setup() # Create temporary database self._create_temp_database() @@ -221,7 +219,6 @@ def __init__(self, *args): PersistentProcessing.__init__(self, *args) def _execute(self): - self._setup() # For debug purpose diff --git a/src/actinia_core/processing/actinia_processing/persistent/raster_colors.py b/src/actinia_core/processing/actinia_processing/persistent/raster_colors.py index 4d02d7469..8940fe841 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/raster_colors.py +++ b/src/actinia_core/processing/actinia_processing/persistent/raster_colors.py @@ -50,11 +50,9 @@ class PersistentRasterColorsRules(PersistentProcessing): """ def __init__(self, *args): - PersistentProcessing.__init__(self, *args) def _execute(self, skip_permission_check=True): - self._setup() raster_name = self.map_name diff --git a/src/actinia_core/processing/actinia_processing/persistent/raster_layer.py b/src/actinia_core/processing/actinia_processing/persistent/raster_layer.py index 5b92d0921..20fc3b451 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/raster_layer.py +++ b/src/actinia_core/processing/actinia_processing/persistent/raster_layer.py @@ -86,7 +86,6 @@ def _execute(self): class PersistentRasterCreator(PersistentProcessing): def __init__(self, *args): - PersistentProcessing.__init__(self, *args) def _execute(self): diff --git a/src/actinia_core/processing/actinia_processing/persistent/resource_storage_management.py b/src/actinia_core/processing/actinia_processing/persistent/resource_storage_management.py index 15b4cd3f7..5e0bf019a 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/resource_storage_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/resource_storage_management.py @@ -55,13 +55,11 @@ def __init__(self, *args): self.olderthan = args[1] def _execute(self): - self._setup() if os.path.exists(self.user_resource_storage_path) and os.path.isdir( self.user_resource_storage_path ): - if self.olderthan is None: # delete all user resources executable = "/bin/rm" diff --git a/src/actinia_core/processing/actinia_processing/persistent/strds_management.py b/src/actinia_core/processing/actinia_processing/persistent/strds_management.py index ee554987b..99da7f672 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/strds_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/strds_management.py @@ -49,12 +49,10 @@ class PersistentSTRDSLister(PersistentProcessing): def __init__(self, *args): - PersistentProcessing.__init__(self, *args) self.response_model_class = StringListProcessingResultResponseModel def _execute(self): - self._setup() pc = { @@ -108,12 +106,10 @@ class PersistentSTRDSInfo(PersistentProcessing): """Gather the STRDS information""" def __init__(self, *args): - PersistentProcessing.__init__(self, *args) self.response_model_class = STRDSInfoResponseModel def _execute(self): - self._setup() pc = { @@ -196,7 +192,6 @@ def __init__(self, *args): PersistentProcessing.__init__(self, *args) def _execute(self): - self._setup() self.required_mapsets.append(self.target_mapset_name) diff --git a/src/actinia_core/processing/actinia_processing/persistent/strds_raster_management.py b/src/actinia_core/processing/actinia_processing/persistent/strds_raster_management.py index a0526b065..3c82bf7d8 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/strds_raster_management.py +++ b/src/actinia_core/processing/actinia_processing/persistent/strds_raster_management.py @@ -49,12 +49,10 @@ class PersistentRasterSTRDSLister(PersistentProcessing): """List all mapsets in a location""" def __init__(self, *args): - PersistentProcessing.__init__(self, *args) self.response_model_class = STRDSRasterListResponseModel def _execute(self): - self._setup() result_file = tempfile.NamedTemporaryFile( @@ -124,7 +122,6 @@ def __init__(self, *args): PersistentProcessing.__init__(self, *args) def _execute(self): - self._setup() input_file = tempfile.NamedTemporaryFile( diff --git a/src/actinia_core/processing/actinia_processing/persistent/vector_layer.py b/src/actinia_core/processing/actinia_processing/persistent/vector_layer.py index b926f2402..986a29f3c 100644 --- a/src/actinia_core/processing/actinia_processing/persistent/vector_layer.py +++ b/src/actinia_core/processing/actinia_processing/persistent/vector_layer.py @@ -87,7 +87,6 @@ def _execute(self): class PersistentVectorCreator(PersistentProcessing): def __init__(self, *args): - PersistentProcessing.__init__(self, *args) def _execute(self): diff --git a/src/actinia_core/rest/api_log_management.py b/src/actinia_core/rest/api_log_management.py index ac879b8c8..085856ab9 100644 --- a/src/actinia_core/rest/api_log_management.py +++ b/src/actinia_core/rest/api_log_management.py @@ -58,7 +58,6 @@ class APILogResource(Resource): decorators = [log_api_call, check_user_permissions, auth.login_required] def __init__(self): - # Configuration Resource.__init__(self) diff --git a/src/actinia_core/rest/base/endpoint_config.py b/src/actinia_core/rest/base/endpoint_config.py index 0378b6c96..fa3dd9951 100644 --- a/src/actinia_core/rest/base/endpoint_config.py +++ b/src/actinia_core/rest/base/endpoint_config.py @@ -79,7 +79,6 @@ def decorator(func): @wraps(func) def wrapper(*args, **kwargs): - if check_endpoint(method, endpoint_class=endpoint_class): result = func(*args, **kwargs) return result diff --git a/src/actinia_core/rest/base/resource_base.py b/src/actinia_core/rest/base/resource_base.py index ec63aa7f1..9c8436a5d 100644 --- a/src/actinia_core/rest/base/resource_base.py +++ b/src/actinia_core/rest/base/resource_base.py @@ -248,7 +248,6 @@ def check_for_json(self): """ # First check for the data field and create JSON from it if hasattr(request, "data") is True: - try: self.request_data = json_loads(request.data) except Exception as e: diff --git a/src/actinia_core/rest/base/user_auth.py b/src/actinia_core/rest/base/user_auth.py index b229d775a..a12e58f75 100644 --- a/src/actinia_core/rest/base/user_auth.py +++ b/src/actinia_core/rest/base/user_auth.py @@ -270,7 +270,6 @@ def check_user_permissions(f): @wraps(f) def decorated_function(*args, **kwargs): - location_name = None mapset_name = None module_name = None diff --git a/src/actinia_core/rest/ephemeral_processing_with_export.py b/src/actinia_core/rest/ephemeral_processing_with_export.py index 0994a26a2..c172f9af8 100644 --- a/src/actinia_core/rest/ephemeral_processing_with_export.py +++ b/src/actinia_core/rest/ephemeral_processing_with_export.py @@ -94,8 +94,8 @@ def __init__(self): check_endpoint("post", ephemeral_processing_with_export.post_doc) ) def post(self, location_name): - """Execute a user defined process chain in an ephemeral location/mapset and - store the processing result in an Amazon S3 bucket + """Execute a user defined process chain in an ephemeral location/mapset + and store the processing result in an Amazon S3 bucket """ rdc = self.preprocess(has_json=True, location_name=location_name) rdc.set_storage_model_to_s3() diff --git a/src/actinia_core/rest/mapsets.py b/src/actinia_core/rest/mapsets.py index c9b25827b..eeebb6bb7 100644 --- a/src/actinia_core/rest/mapsets.py +++ b/src/actinia_core/rest/mapsets.py @@ -67,7 +67,6 @@ class AllMapsetsListingResourceAdmin(ResourceBase): @endpoint_decorator() @swagger.doc(check_endpoint("get", mapsets.get_doc)) def get(self): - if "status" in request.args: if request.args["status"] == "locked": if self.user.has_superadmin_role() is False: diff --git a/src/actinia_core/rest/process_chain_monitoring.py b/src/actinia_core/rest/process_chain_monitoring.py index c738f2112..30c7c474c 100644 --- a/src/actinia_core/rest/process_chain_monitoring.py +++ b/src/actinia_core/rest/process_chain_monitoring.py @@ -51,7 +51,6 @@ def create_scatter_plot(x, y, xlabel, ylabel, title): - plt.clf() plt.scatter(x, y, s=(np.pi * 5), c=(1, 0, 0)) plt.title(title, fontsize=14) @@ -81,7 +80,6 @@ class MapsetSizeResource(ResourceManager): """ def __init__(self): - # Configuration ResourceManager.__init__(self) @@ -144,7 +142,6 @@ class MapsetSizeDiffResource(ResourceManager): """ def __init__(self): - # Configuration ResourceManager.__init__(self) @@ -208,7 +205,6 @@ class MaxMapsetSizeResource(ResourceManager): """ def __init__(self): - # Configuration ResourceManager.__init__(self) @@ -272,7 +268,6 @@ class MapsetSizeRenderResource(ResourceManager): """ def __init__(self): - # Configuration ResourceManager.__init__(self) @@ -354,7 +349,6 @@ class MapsetSizeDiffRenderResource(ResourceManager): """ def __init__(self): - # Configuration ResourceManager.__init__(self) diff --git a/src/actinia_core/rest/process_validation.py b/src/actinia_core/rest/process_validation.py index 99473ef36..827d0e875 100644 --- a/src/actinia_core/rest/process_validation.py +++ b/src/actinia_core/rest/process_validation.py @@ -50,7 +50,6 @@ class AsyncProcessValidationResource(ResourceBase): - decorators = [log_api_call, auth.login_required] @endpoint_decorator() @@ -72,7 +71,6 @@ def post(self, location_name): class SyncProcessValidationResource(ResourceBase): - decorators = [log_api_call, auth.login_required] @endpoint_decorator() diff --git a/src/actinia_core/rest/raster_export.py b/src/actinia_core/rest/raster_export.py index 80e86ca83..6f328edca 100644 --- a/src/actinia_core/rest/raster_export.py +++ b/src/actinia_core/rest/raster_export.py @@ -67,7 +67,6 @@ def post(self, location_name, mapset_name, raster_name): def _execute( self, location_name, mapset_name, raster_name, use_raster_region ): - rdc = self.preprocess( has_json=False, location_name=location_name, diff --git a/src/actinia_core/rest/resource_management.py b/src/actinia_core/rest/resource_management.py index 1dbce4474..974367121 100644 --- a/src/actinia_core/rest/resource_management.py +++ b/src/actinia_core/rest/resource_management.py @@ -69,7 +69,6 @@ class ResourceManagerBase(Resource): decorators = [log_api_call, auth.login_required] def __init__(self): - # Configuration Resource.__init__(self) @@ -195,7 +194,6 @@ class ResourceManager(ResourceManagerBase): """ def __init__(self): - # Configuration ResourceManagerBase.__init__(self) @@ -593,7 +591,6 @@ class ResourcesManager(ResourceManagerBase): """ def __init__(self): - # Configuration ResourceManagerBase.__init__(self) @@ -687,7 +684,6 @@ class ResourceIterationManager(ResourceManagerBase): """ def __init__(self): - # Configuration ResourceManagerBase.__init__(self) diff --git a/src/actinia_core/rest/resource_storage_management.py b/src/actinia_core/rest/resource_storage_management.py index 2613771a5..3bea8b469 100644 --- a/src/actinia_core/rest/resource_storage_management.py +++ b/src/actinia_core/rest/resource_storage_management.py @@ -60,7 +60,6 @@ class SyncResourceStorageResource(ResourceBase): - decorators = [ log_api_call, check_user_permissions, diff --git a/src/actinia_core/rest/resource_streamer.py b/src/actinia_core/rest/resource_streamer.py index 32910e63d..a2568932b 100644 --- a/src/actinia_core/rest/resource_streamer.py +++ b/src/actinia_core/rest/resource_streamer.py @@ -99,7 +99,6 @@ def get(self, user_id, resource_id, file_name): os.path.exists(resource_export_file_path) is True and os.access(resource_export_file_path, os.R_OK) is True ): - return send_from_directory( resource_export_path, file_name, as_attachment=True ) diff --git a/src/actinia_core/testsuite.py b/src/actinia_core/testsuite.py index 3b6ca1444..c481ecf99 100644 --- a/src/actinia_core/testsuite.py +++ b/src/actinia_core/testsuite.py @@ -146,7 +146,6 @@ class ActiniaTestCaseBase(unittest.TestCase): @classmethod def setUpClass(cls): - if cls.server_test is False and cls.custom_actinia_cfg is False: global_config.REDIS_SERVER_SERVER = "localhost" global_config.REDIS_SERVER_PORT = 7000 @@ -237,7 +236,6 @@ def create_user( process_num_limit=1000, process_time_limit=6000, ): - auth = bytes("%s:%s" % (name, password), "utf-8") # We need to create an HTML basic authorization header @@ -267,7 +265,6 @@ def create_user( @classmethod def tearDownClass(cls): - for user in cls.users_list: user.delete() @@ -366,7 +363,6 @@ def waitAsyncStatusAssertHTTP( return resp_data def assertRasterInfo(self, location, mapset, raster, ref_info, header): - url = ( f"{URL_PREFIX}/locations/{location}/mapsets/{mapset}/" f"raster_layers/{raster}" @@ -388,7 +384,6 @@ def assertRasterInfo(self, location, mapset, raster, ref_info, header): ) def assertVectorInfo(self, location, mapset, vector, ref_info, header): - url = ( f"{URL_PREFIX}/locations/{location}/mapsets/{mapset}/" f"vector_layers/{vector}" diff --git a/tests/test_api_logging.py b/tests/test_api_logging.py index 828975b24..4f6b13829 100644 --- a/tests/test_api_logging.py +++ b/tests/test_api_logging.py @@ -68,7 +68,6 @@ def tearDown(self): self.app_context.pop() def test_logging(self): - ret = self.log.add_entry( user_id=self.user_id, http_request=self.request_object ) diff --git a/tests/test_async_mapset_merging_strds.py b/tests/test_async_mapset_merging_strds.py index c54187e55..c35255aaf 100644 --- a/tests/test_async_mapset_merging_strds.py +++ b/tests/test_async_mapset_merging_strds.py @@ -243,7 +243,6 @@ class AsyncMapsetMergingSTRDS(ActiniaResourceTestCaseBase): - user_mapset = mapset_name raster_dict_modis = { "MOD11B3.A2015001.h11v05.single_LST_Day_6km": "2015-01-01 00:00:00", @@ -317,7 +316,6 @@ def check_modis_strds(self, raster_dict, strds_name): ) def test_create_strds_in_persistent_user_db(self): - rv = self.server.post( f"{URL_PREFIX}/locations/nc_spm_08/mapsets/{self.user_mapset}/" "processing_async", @@ -374,7 +372,6 @@ def test_create_strds_in_persistent_user_db_and_list_it(self): self.check_modis_strds(self.raster_dict_modis, "modis") def test_create_strds_in_persistent_user_db_2(self): - rv = self.server.post( f"{URL_PREFIX}/locations/nc_spm_08/mapsets/{self.user_mapset}/" "processing_async", @@ -412,7 +409,6 @@ def test_create_strds_in_persistent_user_db_2(self): self.check_modis_strds(self.raster_dict_modis2, "modis2") def test_create_strds_in_persistent_user_db_3(self): - rv = self.server.post( f"{URL_PREFIX}/locations/nc_spm_08/mapsets/{self.user_mapset}/" "processing_async", diff --git a/tests/test_async_processing.py b/tests/test_async_processing.py index 63c6d8806..c5d1486a4 100644 --- a/tests/test_async_processing.py +++ b/tests/test_async_processing.py @@ -173,7 +173,6 @@ class AsyncProcessTestCase(ActiniaResourceTestCaseBase): def test_async_processing(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.admin_auth_header, @@ -188,7 +187,6 @@ def test_async_processing(self): ) def test_async_processing_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.admin_auth_header, @@ -246,7 +244,6 @@ def test_async_processing_termination(self): time.sleep(1) def test_async_processing_large_region(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.user_auth_header, @@ -302,7 +299,6 @@ def test_async_processing_error_2(self): ) def test_async_processing_error_3(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.user_auth_header, @@ -318,7 +314,6 @@ def test_async_processing_error_3(self): ) def test_async_processing_error_4(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.user_auth_header, @@ -352,7 +347,6 @@ def test_async_processing_error_5(self): ) def test_async_processing_error_6(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.user_auth_header, @@ -368,7 +362,6 @@ def test_async_processing_error_6(self): ) def test_async_processing_error_7(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async", headers=self.user_auth_header, diff --git a/tests/test_async_processing_custom.py b/tests/test_async_processing_custom.py index fee321af5..e7a4e32a5 100644 --- a/tests/test_async_processing_custom.py +++ b/tests/test_async_processing_custom.py @@ -43,7 +43,6 @@ class AsyncProcessCustomTestCaseAdmin(ActiniaResourceTestCaseBase): def test_async_processing(self): - rv = self.server.post( URL_PREFIX + "/custom_process/uname", headers=self.admin_auth_header, diff --git a/tests/test_async_processing_export.py b/tests/test_async_processing_export.py index b76ce5a90..d0dffd00e 100644 --- a/tests/test_async_processing_export.py +++ b/tests/test_async_processing_export.py @@ -325,7 +325,6 @@ class AsyncProcessExportTestCaseUser(ActiniaResourceTestCaseBase): def test_async_processing(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.user_auth_header, @@ -405,7 +404,6 @@ def test_large_Region_fail(self): ) def test_termination_1(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -429,7 +427,6 @@ def test_termination_1(self): ) def test_termination_2(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.user_auth_header, @@ -453,7 +450,6 @@ def test_termination_2(self): ) def test_termination_3(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.root_auth_header, @@ -477,7 +473,6 @@ def test_termination_3(self): ) def test_error_1(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.user_auth_header, @@ -493,7 +488,6 @@ def test_error_1(self): ) def test_error_2(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.user_auth_header, @@ -509,7 +503,6 @@ def test_error_2(self): ) def test_error_3(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.user_auth_header, @@ -525,7 +518,6 @@ def test_error_3(self): ) def test_error_4(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.user_auth_header, @@ -569,7 +561,6 @@ def test_stac_export(self): class AsyncProcessExportTestCaseAdmin(ActiniaResourceTestCaseBase): def test_async_processing(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -596,7 +587,6 @@ def test_async_processing(self): ) def test_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -620,7 +610,6 @@ def test_termination(self): ) def test_error_1(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -636,7 +625,6 @@ def test_error_1(self): ) def test_error_2(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -652,7 +640,6 @@ def test_error_2(self): ) def test_error_3(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -668,7 +655,6 @@ def test_error_3(self): ) def test_error_4(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, diff --git a/tests/test_async_processing_export_file.py b/tests/test_async_processing_export_file.py index 7637c7800..a1d197a45 100644 --- a/tests/test_async_processing_export_file.py +++ b/tests/test_async_processing_export_file.py @@ -122,7 +122,6 @@ def test_async_processing_file_export(self): print(rv.iter_encoded()) def test_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -159,7 +158,6 @@ class AsyncProcessExportTestCaseAdminS3(ActiniaResourceTestCaseBase): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_async_processing_export(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_s3", headers=self.admin_auth_header, @@ -190,7 +188,6 @@ def test_async_processing_export(self): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_s3", headers=self.admin_auth_header, @@ -227,7 +224,6 @@ class AsyncProcessExportTestCaseAdminGCS(ActiniaResourceTestCaseBase): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_async_processing_export(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_gcs", headers=self.admin_auth_header, @@ -258,7 +254,6 @@ def test_async_processing_export(self): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_gcs", headers=self.admin_auth_header, diff --git a/tests/test_async_processing_export_to_storage.py b/tests/test_async_processing_export_to_storage.py index 4ae3239b1..43130391d 100644 --- a/tests/test_async_processing_export_to_storage.py +++ b/tests/test_async_processing_export_to_storage.py @@ -86,7 +86,6 @@ class AsyncProcessExport2TestCaseAdmin(ActiniaResourceTestCaseBase): def test_async_processing_export(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export", headers=self.admin_auth_header, @@ -158,7 +157,6 @@ def test_async_processing_export(self): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_s3", headers=self.admin_auth_header, @@ -195,7 +193,6 @@ class AsyncProcessExportTestCaseAdminGCS(ActiniaResourceTestCaseBase): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_async_processing_export(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_gcs", headers=self.admin_auth_header, @@ -226,7 +223,6 @@ def test_async_processing_export(self): "'GOOGLE_CLOUD_PROJECT' not set", ) def test_termination(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/processing_async_export_gcs", headers=self.admin_auth_header, diff --git a/tests/test_async_processing_mapset.py b/tests/test_async_processing_mapset.py index 028ba1932..75086a0a6 100644 --- a/tests/test_async_processing_mapset.py +++ b/tests/test_async_processing_mapset.py @@ -105,7 +105,6 @@ class AsyncProcessMapsetTestCaseAdmin(ActiniaResourceTestCaseBase): def check_remove_test_mapset(self): - rv = self.server.get( URL_PREFIX + "/locations/nc_spm_08/mapsets", headers=self.user_auth_header, @@ -449,7 +448,6 @@ def test_3_existing_mapset_lock(self): ) def test_4_create_global_mapset(self): - rv = self.server.post( URL_PREFIX + "/locations/nc_spm_08/mapsets/PERMANENT/processing_async", diff --git a/tests/test_async_raster_export.py b/tests/test_async_raster_export.py index d5420c143..8ce19dcbc 100644 --- a/tests/test_async_raster_export.py +++ b/tests/test_async_raster_export.py @@ -43,7 +43,6 @@ class RasterAsyncExport(ActiniaResourceTestCaseBase): def test_export(self): - rv = self.server.post( f"{URL_PREFIX}/locations/nc_spm_08/mapsets/PERMANENT/raster_layers" "/elevation/geotiff_async", @@ -72,7 +71,6 @@ def test_export(self): time.sleep(1) def test_export_region(self): - rv = self.server.post( f"{URL_PREFIX}/locations/nc_spm_08/mapsets/PERMANENT/raster_layers" "/elevation/geotiff_async_orig", @@ -101,7 +99,6 @@ def test_export_region(self): time.sleep(1) def test_export_error(self): - rv = self.server.post( f"{URL_PREFIX}/locations/nc_spm_08/mapsets/PERMANENT/" "raster_layers/elevationion/geotiff_async", diff --git a/tests/test_aws_sentinel_interface.py b/tests/test_aws_sentinel_interface.py index 16535653e..2a0d799ae 100644 --- a/tests/test_aws_sentinel_interface.py +++ b/tests/test_aws_sentinel_interface.py @@ -55,10 +55,8 @@ def tearDown(self): pass def validate_result(self, result, bands): - for scene in result: for tile in scene["tiles"]: - url = tile["info"] response = urlopen(url) mime_type = magic.from_buffer( diff --git a/tests/test_common_base.py b/tests/test_common_base.py index 8919c956a..a99c881a5 100644 --- a/tests/test_common_base.py +++ b/tests/test_common_base.py @@ -50,7 +50,6 @@ def setup_environment(): - # If docker config if custom_actinia_cfg is not False: global_config.read(custom_actinia_cfg) @@ -102,7 +101,6 @@ class CommonTestCaseBase(unittest.TestCase): @classmethod def setUpClass(cls): - if custom_actinia_cfg is not False: global_config.read(custom_actinia_cfg) print(global_config) diff --git a/tests/test_configuration.py b/tests/test_configuration.py index f109f4bef..d46d97abe 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -44,7 +44,6 @@ class ConfigurationTestCase(unittest.TestCase): file_name = "/tmp/actinia_test.cfg" def test_change_loglevel(self): - c = Configuration() c.write(self.file_name) @@ -58,7 +57,6 @@ def test_change_loglevel(self): self.assertEqual(c.LOG_LEVEL, 1) def test_read_write_exceptions(self): - c = Configuration() self.assertRaises(IOError, c.read, "/dk/l/K/D/V/l/d/g") self.assertRaises(IOError, c.write, "/dk/l/K/D/V/l/d/g") diff --git a/tests/test_download_cache.py b/tests/test_download_cache.py index a890d2128..e10386645 100644 --- a/tests/test_download_cache.py +++ b/tests/test_download_cache.py @@ -52,7 +52,6 @@ class DownloadCacheTestCase(ActiniaResourceTestCaseBase): def test_download_cache(self): - global_config.DOWNLOAD_CACHE = "/tmp/dcache_tmp" global_config.DOWNLOAD_CACHE_QUOTA = 1 try: @@ -119,7 +118,6 @@ def test_download_cache(self): ) def test_download_cache_error_1(self): - if os.path.isdir("/tmp/dcache_tmp_nope") is True: os.rmdir("/tmp/dcache_tmp_nope") @@ -140,7 +138,6 @@ def test_download_cache_error_1(self): ) def test_download_cache_error_2(self): - if os.path.isdir("/tmp/dcache_tmp_nope") is True: os.rmdir("/tmp/dcache_tmp_nope") diff --git a/tests/test_geodata_import.py b/tests/test_geodata_import.py index 5304b0791..a21ab6511 100644 --- a/tests/test_geodata_import.py +++ b/tests/test_geodata_import.py @@ -86,7 +86,6 @@ def tearDown(self): pass def _run_process(self, process): - print("Run process: " + str(process)) inputlist = list() @@ -108,7 +107,6 @@ def _run_process(self, process): ) def test_download_commands_gml(self): - gml = additional_external_data["census_wake2000_gml"] gddl = GeoDataDownloadImportSupport( @@ -138,7 +136,6 @@ def test_download_commands_gml(self): self.assertEqual("v.import", p.executable) def test_download_commands_gml_zip(self): - url_list = [] gml = additional_external_data["census_wake2000_gml"] @@ -171,7 +168,6 @@ def test_download_commands_gml_zip(self): gddl.perform_file_validation(filepath=file_name) def test_download_commands_tif(self): - tif_list = [] tif_list.append(additional_external_data["geology_30m_tif"]) tif_list.append(additional_external_data["geology_30m_tif"]) @@ -209,7 +205,6 @@ def test_download_commands_tif(self): self.assertEqual("r.import", p.executable) def test_landsat_download_commands(self): - lp = LandsatProcessing( config=global_config, temp_file_path="/tmp", diff --git a/tests/test_job_resumption.py b/tests/test_job_resumption.py index 6d48b9158..bb9d564b7 100644 --- a/tests/test_job_resumption.py +++ b/tests/test_job_resumption.py @@ -286,7 +286,6 @@ class JobResumptionProcessingTestCase(ActiniaResourceTestCaseBase): - cfg_file = os.environ.get( "ACTINIA_CUSTOM_TEST_CFG", "/etc/default/actinia" ) @@ -919,7 +918,6 @@ def test_resource_endpoints(self): class JobResumptionProcessingExportTestCase(JobResumptionProcessingTestCase): - endpoint = "/locations/nc_spm_08/processing_async_export" resource_user_id = None resource_resource_id = None @@ -1079,7 +1077,6 @@ def test_job_2_times_resumption_exporter(self): class JobResumptionPersistentProcessingTestCase( JobResumptionProcessingTestCase ): - location = "nc_spm_08" mapset = "test_mapset" endpoint = "/locations/%s/mapsets/%s/processing_async" % (location, mapset) @@ -1154,7 +1151,6 @@ def test_resource_endpoints(self): class JobResumptionErrorTestCase(ActiniaResourceTestCaseBase): - endpoint = "/locations/nc_spm_08/processing_async" def test_job_resumption_config_error(self): diff --git a/tests/test_location_management.py b/tests/test_location_management.py index d8ea3406c..29aad9e1b 100644 --- a/tests/test_location_management.py +++ b/tests/test_location_management.py @@ -104,7 +104,6 @@ def test_location_global_db_error(self): ) def test_location_creation_and_deletion(self): - # Delete a potentially existing location rv = self.server.delete( URL_PREFIX + "/locations/test_location", @@ -176,7 +175,6 @@ def test_location_creation_and_deletion(self): ) def test_location_creation_and_deletion_as_user(self): - # Delete a potentially existing location rv = self.server.delete( URL_PREFIX + "/locations/test_location", @@ -256,7 +254,6 @@ def test_location_creation_and_deletion_as_user(self): ) def test_location_creation_and_deletion_as_guest(self): - # ERROR: Try to create a location as guest rv = self.server.post( URL_PREFIX + "/locations/test_location_user", diff --git a/tests/test_login.py b/tests/test_login.py index 01840a84c..1dc04d826 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -284,7 +284,6 @@ def test_get_own_userid(self): ) def test_token_generation_admin(self): - rv = self.server.get( URL_PREFIX + "/token", headers=self.admin_auth_header ) @@ -299,7 +298,6 @@ def test_token_generation_admin(self): ) def test_api_key_generation_admin(self): - rv = self.server.get( URL_PREFIX + "/api_key", headers=self.admin_auth_header ) @@ -314,7 +312,6 @@ def test_api_key_generation_admin(self): ) def test_token_generation_user(self): - rv = self.server.get( URL_PREFIX + "/token", headers=self.user_auth_header ) @@ -329,7 +326,6 @@ def test_token_generation_user(self): ) def test_token_generation_user_expire(self): - rv = self.server.get( URL_PREFIX + "/token?expiration_time=3600", headers=self.user_auth_header, @@ -345,7 +341,6 @@ def test_token_generation_user_expire(self): ) def test_token_generation_guest(self): - rv = self.server.get( URL_PREFIX + "/token", headers=self.guest_auth_header ) @@ -360,7 +355,6 @@ def test_token_generation_guest(self): ) def test_token_generation_wrong_no_auth(self): - rv = self.server.get(URL_PREFIX + "/token") print(rv.data) self.assertEqual( @@ -373,7 +367,6 @@ def test_token_generation_wrong_no_auth(self): ) def test_api_key_generation_wrong_user(self): - rv = self.server.get( URL_PREFIX + "/api_key", headers=self.user_auth_header ) @@ -388,7 +381,6 @@ def test_api_key_generation_wrong_user(self): ) def test_token_generation_user_expire_error(self): - rv = self.server.get( URL_PREFIX + "/token?expiration_time=1000000000", headers=self.user_auth_header, @@ -404,7 +396,6 @@ def test_token_generation_user_expire_error(self): ) def test_token_generation_user_expire_wrong(self): - rv = self.server.get( URL_PREFIX + "/token?expiration_time=blablub", headers=self.user_auth_header, diff --git a/tests/test_mapsets.py b/tests/test_mapsets.py index 0f7c4a3e9..53b61a37d 100644 --- a/tests/test_mapsets.py +++ b/tests/test_mapsets.py @@ -40,7 +40,6 @@ class MapsetsTestCase(ActiniaResourceTestCaseBase): - test_mapsets = [str(uuid.uuid4()), str(uuid.uuid4())] test_user = f"test_user_{str(uuid.uuid4())}" accessible_datasets = { diff --git a/tests/test_message_logger.py b/tests/test_message_logger.py index 103fa7463..19381bb4c 100644 --- a/tests/test_message_logger.py +++ b/tests/test_message_logger.py @@ -44,7 +44,6 @@ class MessageLoggerTestCase(unittest.TestCase): """ def test_change_loglevel(self): - c = Configuration() c.LOG_LEVEL = 4 @@ -82,7 +81,6 @@ def test_change_loglevel(self): logger.error("error") def test_fluentd(self): - c = Configuration() c.LOG_LEVEL = 4 c.LOG_INTERFACE = "fluentd" diff --git a/tests/test_process_queue.py b/tests/test_process_queue.py index d22bdc7ff..07f981942 100644 --- a/tests/test_process_queue.py +++ b/tests/test_process_queue.py @@ -107,7 +107,6 @@ def tearDown(self): self.app_context.pop() def otest_1(self): - create_process_queue(config=global_config, use_logger=False) args = deepcopy(self.rdc) @@ -144,7 +143,6 @@ def otest_1(self): return def otest_2(self): - create_process_queue(config=global_config, use_logger=False) args = deepcopy(self.rdc) diff --git a/tests/test_raster_colors.py b/tests/test_raster_colors.py index 850ee1613..0b53be820 100644 --- a/tests/test_raster_colors.py +++ b/tests/test_raster_colors.py @@ -65,7 +65,6 @@ def test_raster_layer_get_colors(self): self.assertTrue(len(colors) == 8) def test_raster_layer_set_colors(self): - new_mapset = "raster_test_mapset" self.create_new_mapset(new_mapset) diff --git a/tests/test_raster_layer.py b/tests/test_raster_layer.py index e68c52f18..d43b41df7 100644 --- a/tests/test_raster_layer.py +++ b/tests/test_raster_layer.py @@ -44,7 +44,6 @@ class RasterLayerTestCase(ActiniaResourceTestCaseBase): - # TODO create test for CREATION (upload) def test_raster_layer_info(self): diff --git a/tests/test_raster_layers.py b/tests/test_raster_layers.py index 03c9940a3..2af3fe259 100644 --- a/tests/test_raster_layers.py +++ b/tests/test_raster_layers.py @@ -166,7 +166,6 @@ def test_list_raster_layers_empty_list(self): self.assertTrue(len(map_list) == 0) def test_remove_raster_layers_pattern(self): - new_mapset = "raster_test_mapset" self.create_new_mapset(new_mapset) @@ -224,7 +223,6 @@ def test_remove_raster_layers_pattern(self): print(rv.data.decode()) def test_rename_raster_layers(self): - new_mapset = "raster_test_mapset" self.create_new_mapset(new_mapset) diff --git a/tests/test_raster_upload.py b/tests/test_raster_upload.py index cedba149b..db56fcb4a 100644 --- a/tests/test_raster_upload.py +++ b/tests/test_raster_upload.py @@ -48,7 +48,6 @@ class UploadRasterLayerTestCase(ActiniaResourceTestCaseBase): - location = "nc_spm_08" mapset = "PERMANENT" tmp_mapset = "mapset_upload" diff --git a/tests/test_resource_logging.py b/tests/test_resource_logging.py index c88f66eb0..a8cbecf00 100644 --- a/tests/test_resource_logging.py +++ b/tests/test_resource_logging.py @@ -73,7 +73,6 @@ def tearDown(self): self.app_context.pop() def test_logging(self): - ret = self.log.commit( user_id=self.user_id, resource_id=self.resource_id, @@ -115,7 +114,6 @@ def test_logging(self): self.assertFalse(ret) def test_list(self): - user = "lisa" resource = "a" ret = self.log.commit( @@ -184,7 +182,6 @@ def test_list(self): print(ret) def test_termination(self): - ret = self.log.commit_termination( user_id=self.user_id, resource_id=self.resource_id ) diff --git a/tests/test_strds_management.py b/tests/test_strds_management.py index cba6cd862..a3e2b86e7 100644 --- a/tests/test_strds_management.py +++ b/tests/test_strds_management.py @@ -127,7 +127,6 @@ def test_strds_info(self): self.assertEqual(start_time, "'2015-01-01 00:00:00'") def test_strds_create_remove(self): - new_mapset = "strds_test" self.create_new_mapset(mapset_name=new_mapset, location_name=location) diff --git a/tests/test_strds_raster_management.py b/tests/test_strds_raster_management.py index 55a45c2bd..9152af145 100644 --- a/tests/test_strds_raster_management.py +++ b/tests/test_strds_raster_management.py @@ -116,7 +116,6 @@ def create_raster_layer( ) def test_strds_creation_error(self): - # This must fail, global mapsets are not allowed to modify rv = self.server.post( f"{URL_PREFIX}/locations/{location}/mapsets/{strds_mapset}/strds/" @@ -142,7 +141,6 @@ def test_strds_creation_error(self): ) def test_strds_create_register_unregister_1(self): - self.create_new_mapset(new_mapset, location) # Create success diff --git a/tests/test_strds_raster_renderer.py b/tests/test_strds_raster_renderer.py index 9198466c0..2b60a4ff9 100644 --- a/tests/test_strds_raster_renderer.py +++ b/tests/test_strds_raster_renderer.py @@ -115,7 +115,6 @@ def create_raster_layer( ) def test_strds_render_1(self): - new_mapset = "strds_render_test" self.create_new_mapset(new_mapset, location) diff --git a/tests/test_user_management.py b/tests/test_user_management.py index 0367d2d0e..ed47b1ed6 100644 --- a/tests/test_user_management.py +++ b/tests/test_user_management.py @@ -62,7 +62,6 @@ def tearDown(self): self.app_context.pop() def test_create_delete_user(self): - # Make sure the user database is empty user = ActiniaUser(self.user_id) if user.exists(): diff --git a/tests/test_vector_upload.py b/tests/test_vector_upload.py index 986368df3..56c4eec63 100644 --- a/tests/test_vector_upload.py +++ b/tests/test_vector_upload.py @@ -80,7 +80,6 @@ class UploadVectorLayerTestCase(ActiniaResourceTestCaseBase): - location = "nc_spm_08" mapset = "PERMANENT" tmp_mapset = "mapset_upload" diff --git a/tests/unittests/test_version.py b/tests/unittests/test_version.py index f4f28fa91..f07ebf1d3 100644 --- a/tests/unittests/test_version.py +++ b/tests/unittests/test_version.py @@ -70,7 +70,6 @@ def test_valid_additional_version_info_key(key, status): @pytest.mark.unittest @pytest.mark.parametrize("use_env,val", [(False, "n/a"), (True, "test")]) def test_find_running_since_info(use_env, val): - if use_env is True: os.environ["ACTINIA_RUNNING_SINCE"] = val test = find_running_since_info() @@ -97,7 +96,6 @@ def test_find_running_since_info(use_env, val): ], ) def test_parse_additional_version_info(env_value, expected): - test = parse_additional_version_info(env_value) assert test == expected, "Find additional version is not right" @@ -127,7 +125,6 @@ def test_parse_additional_version_info(env_value, expected): ], ) def test_find_additional_version_info(env_value, expected): - if env_value != "": os.environ["ACTINIA_ADDITIONAL_VERSION_INFO"] = env_value else: