Skip to content

Commit

Permalink
Update testing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
teekuningas committed Mar 16, 2024
1 parent ff48df5 commit c0a5cec
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions meggie/utilities/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,6 @@ def initialize_ui(self):
pass


def load_action_spec(action_name):
action_path = pkg_resources.resource_filename("meggie", "actions")
config_path = os.path.join(action_path, action_name, "configuration.json")
with open(config_path, "r") as f:
action_spec = json.load(f)
return action_spec


def patched_messagebox(parent, message):
raise Exception(message)

Expand Down Expand Up @@ -337,12 +329,19 @@ def run_action(self, action_name, handler, data={}, patch_paths=[]):
# call the action handler
data = data.copy()
data.update({"tab_id": "test_tab"})
action_spec = load_action_spec(action_name)
action_spec = self.load_action_spec(action_name)
self.action_instance = handler(
self.experiment, data, self.mock_main_window, action_spec
)
return self.action_instance.run()

def load_action_spec(self, action_name):
action_path = pkg_resources.resource_filename("meggie", "actions")
config_path = os.path.join(action_path, action_name, "configuration.json")
with open(config_path, "r") as f:
action_spec = json.load(f)
return action_spec

def find_dialog(self, dialog_class):
count = 0
for widget in QApplication.topLevelWidgets():
Expand Down

0 comments on commit c0a5cec

Please sign in to comment.