Skip to content

Commit

Permalink
Testing api connection
Browse files Browse the repository at this point in the history
  • Loading branch information
jslane-h committed Jul 25, 2023
1 parent 845b775 commit e8201d7
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
from rect_connect import CustomItem
import json
import time
from api.workflow import Workflow
import warnings
import unittest, sys, datetime, copy


with open("dependencies.json") as file:
Expand Down Expand Up @@ -191,10 +194,12 @@ def dfs_helper(item, path):
visited.add(item)

if item not in items or not item.children:
# item is a leaf node
item.setBrush("red")
item.state["End"] = "True"
paths.append(path[:])
else:
# item is not a leaf node
item.setBrush()

for child in item.children:
Expand Down Expand Up @@ -223,9 +228,11 @@ def dfs_helper(item, path):
def validate_form(self, data):
workflow_path = self.get_workflow()
json_data = self.create_json(workflow_path)
valid = True
if valid:
self.submit_button.setEnabled(True)
current_workflow = "current_workflow.json"
test = TestWorkflow(current_workflow)
test.test_run_workflow()
# if valid:
# self.submit_button.setEnabled(True)


class UserSetting(QDialog):
Expand Down Expand Up @@ -260,6 +267,18 @@ def showAdvanced(self):
self.gui.show()


class TestWorkflow(unittest.TestCase):
def __init__(self, workflow):
super().__init__()
self.workflow = workflow

def test_run_workflow(self):
warnings.simplefilter(action="ignore", category=FutureWarning)
warnings.simplefilter(action="ignore", category=ResourceWarning)
workflow = Workflow(workflow="current_workflow.json")
workflow.run_workflow(verbose=True)


app = QApplication(sys.argv)

window = UserSetting()
Expand Down

0 comments on commit e8201d7

Please sign in to comment.