2222from packaging .version import Version
2323from pathlib import Path
2424
25+ SKIP_SDK_APP = {"success" : True , "message" : "TEST SKIPPED - SDK app detected" }
26+
2527
2628class JSONTests (TestSuite ):
2729 def __init__ (self , repo_location : Path ) -> None :
@@ -30,12 +32,6 @@ def __init__(self, repo_location: Path) -> None:
3032
3133 self ._app_is_certified = self ._parser .app_json ["publisher" ] == "Splunk"
3234
33- def _skip_if_sdk_app (self ):
34- """Helper method to skip tests for SDK apps"""
35- if self ._parser .uv_lock_file is not None :
36- return {"success" : True , "message" : "TEST SKIPPED - SDK app detected" }
37- return None
38-
3935 @staticmethod
4036 def format_as_index (indices : list [Any ], container : str = "schema" ) -> str :
4137 """
@@ -64,8 +60,8 @@ def validate_json_schema(self):
6460 """
6561 Validates the structure of the app json
6662 """
67- if skip_result := self ._skip_if_sdk_app () :
68- return skip_result
63+ if self ._parser . uv_lovk_filepath :
64+ return SKIP_SDK_APP
6965
7066 APP_TESTS_DIR = Path (__file__ ).parent .resolve ()
7167 schema_path = APP_TESTS_DIR / "app_schema.json"
@@ -97,8 +93,8 @@ def check_extra_fields_app_json(self):
9793 """
9894 Makes sure certain fields are not in the app json
9995 """
100- if skip_result := self ._skip_if_sdk_app () :
101- return skip_result
96+ if self ._parser . uv_lovk_filepath :
97+ return SKIP_SDK_APP
10298
10399 to_remove = []
104100 msg = TEST_PASS_MESSAGE
@@ -123,8 +119,8 @@ def check_sequential_order(self):
123119 are sequential and zero-indexed
124120 """
125121
126- if skip_result := self ._skip_if_sdk_app () :
127- return skip_result
122+ if self ._parser . uv_lovk_filepath :
123+ return SKIP_SDK_APP
128124
129125 def check_sequence (order_tuples ):
130126 try :
@@ -190,8 +186,8 @@ def check_main_module(self):
190186 """
191187 Verifies that the main module field of the json is a valid connector filename
192188 """
193- if skip_result := self ._skip_if_sdk_app () :
194- return skip_result
189+ if self ._parser . uv_lovk_filepath :
190+ return SKIP_SDK_APP
195191
196192 app_json = self ._app_json
197193 verbose = []
@@ -324,8 +320,8 @@ def check_action_param_prefixes(self):
324320 """
325321 Every parameter has an action_result.parameter associated with it
326322 """
327- if skip_result := self ._skip_if_sdk_app () :
328- return skip_result
323+ if self ._parser . uv_lovk_filepath :
324+ return SKIP_SDK_APP
329325
330326 app_json_actions = self ._app_json .get ("actions" )
331327
@@ -378,8 +374,8 @@ def check_action_param_matching_contains(self):
378374 """
379375 Every parameter for an action with contains has an action_result.parameter with the same contains
380376 """
381- if skip_result := self ._skip_if_sdk_app () :
382- return skip_result
377+ if self ._parser . uv_lovk_filepath :
378+ return SKIP_SDK_APP
383379
384380 action_list = [act for act in self ._app_json ["actions" ]]
385381 verbose = []
@@ -422,8 +418,8 @@ def check_minimal_data_paths(self):
422418 """
423419 Checks to make sure each action includes the minimal required data paths
424420 """
425- if skip_result := self ._skip_if_sdk_app () :
426- return skip_result
421+ if self ._parser . uv_lovk_filepath :
422+ return SKIP_SDK_APP
427423
428424 app_json_actions = [act for act in self ._app_json ["actions" ]]
429425 verbose = []
@@ -534,8 +530,8 @@ def check_pip313_dependencies(self):
534530 """
535531 Ensures pip313_dependencies key exists and has appropriate content based on requirements.txt
536532 """
537- if skip_result := self ._skip_if_sdk_app () :
538- return skip_result
533+ if self ._parser . uv_lovk_filepath :
534+ return SKIP_SDK_APP
539535
540536 verbose = []
541537 message = TEST_PASS_MESSAGE
0 commit comments