diff --git a/src/pg_to_evalscript/utils.py b/src/pg_to_evalscript/utils.py index aef24ed..0b2f6cc 100644 --- a/src/pg_to_evalscript/utils.py +++ b/src/pg_to_evalscript/utils.py @@ -1,11 +1,12 @@ import pkg_resources +implicitly_supported_processes = ["load_collection", "save_result"] def list_supported_processes(): process_definitions_directory = "javascript_processes" - implicitly_supported_processes = ["load_collection", "save_result", "reduce_dimension", "apply"] process_definition_files = pkg_resources.resource_listdir("pg_to_evalscript", f"{process_definitions_directory}") supported_processes_with_files = [ process_definition_file.replace(".js", "") for process_definition_file in process_definition_files ] - return [*implicitly_supported_processes, *supported_processes_with_files] + unique_supported_processes = list(set([*implicitly_supported_processes, *supported_processes_with_files])) + return unique_supported_processes diff --git a/tests/integration_tests/test_integration.py b/tests/integration_tests/test_integration.py index fcfc07e..7b73605 100644 --- a/tests/integration_tests/test_integration.py +++ b/tests/integration_tests/test_integration.py @@ -2,6 +2,7 @@ import pytest from pg_to_evalscript import convert_from_process_graph, list_supported_processes +from pg_to_evalscript.utils import implicitly_supported_processes from tests.utils import ( get_process_graph_json, @@ -260,13 +261,10 @@ def test_process_graphs_with_scenes(pg_name, example_input, scenes, expected_out def test_list_supported_processes(): - known_supported_processes = [ - "load_collection", - "save_result", - "reduce_dimension", - "apply", + known_supported_processes = list(set([ + *implicitly_supported_processes, *get_defined_processes_from_files(), - ] + ])) supported_processes = list_supported_processes() assert len(known_supported_processes) == len(supported_processes) assert set(known_supported_processes) == set(supported_processes)