Skip to content

Commit

Permalink
decrease test step to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
iYingg committed Dec 11, 2024
1 parent c4a95e0 commit 49f8c8c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,28 @@ def wait_for_comfy_ready(host="127.0.0.1", port=8188, wait_time_secs=120):
print(f"Timeout {wait_time_secs} secs. ComfyUI Server not ready.")
exit(1)


def modify_steps_decorator(func):
def wrapper(*args, **kwargs):
json_content = func(*args, **kwargs)

try:
data = json.loads(json_content)
except json.JSONDecodeError as e:
raise ValueError(f"Invalid JSON content: {e}")

for node in data['nodes']:
if node['type'] == 'BizyAir_BasicScheduler':
if len(node['widgets_values']) == 3:
node['widgets_values'][1] = 1
else:
raise ValueError("BizyAir_BasicScheduler widget values is wrong")

modified_json_content = json.dumps(data, indent=2)
return modified_json_content

return wrapper

@modify_steps_decorator
def read_workflow_json(filename) -> str:
_, extension = os.path.splitext(filename)
if extension.endswith("json"):
Expand Down

0 comments on commit 49f8c8c

Please sign in to comment.