Skip to content

Commit 3e93979

Browse files
committed
Fix test function
1 parent 9e49a10 commit 3e93979

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

afw.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,24 @@ def call(query):
142142
@click.argument("query")
143143
def test(workflow_path: str, query: str):
144144
try:
145-
module = importlib.import_module(workflow_path)
145+
module = importlib.import_module(workflow_path, "main")
146146
except ImportError as e:
147147
print(e)
148-
pass
148+
exit(1)
149149

150-
print(module.call_workflow(wf=Workflow3()))
151-
click.echo("test...todo")
150+
from logging import Logger
151+
import dataclasses
152+
import json
153+
154+
logger = Logger(__file__)
155+
156+
wf = Workflow3()
157+
print(wf.args)
158+
print(wf.args[2:])
159+
160+
responses = module.main(args=wf.args[2:], logger=logger)
161+
for response in responses:
162+
print(json.dumps(dataclasses.asdict(response), indent=4))
152163

153164

154165
if __name__ == "__main__":

0 commit comments

Comments
 (0)