Skip to content

Commit

Permalink
renaming functions as per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPaulBennett authored and MetRonnie committed Dec 12, 2023
1 parent 26c83e4 commit fcfb430
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cylc/uiserver/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,13 @@ async def list_elements(args):
conn = dao.connect()
if 'tasks' in args:
elements.extend(
make_jobs_query(conn, workflow, args.get('tasks')))
run_jobs_query(conn, workflow, args.get('tasks')))
else:
elements.extend(make_task_query(conn, workflow))
elements.extend(run_task_query(conn, workflow))
return elements


def make_task_query(conn, workflow):
def run_task_query(conn, workflow):

# TODO: support all arguments including states
# https://github.com/cylc/cylc-uiserver/issues/440
Expand Down Expand Up @@ -459,7 +459,7 @@ def make_task_query(conn, workflow):
return tasks


def make_jobs_query(conn, workflow, tasks):
def run_jobs_query(conn, workflow, tasks):

# TODO: support all arguments including states
# https://github.com/cylc/cylc-uiserver/issues/440
Expand Down
10 changes: 5 additions & 5 deletions cylc/uiserver/tests/test_workflow_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sqlite3

from cylc.flow.id import Tokens
from cylc.uiserver.schema import make_task_query, make_jobs_query
from cylc.uiserver.schema import run_task_query, run_jobs_query

'''This file tests the ability for the cylc UI to retrieve workflow information
and perform simple statistical calculations for the analysis tab'''
Expand All @@ -43,7 +43,7 @@ def test_make_task_query_1():
conn.commit()
workflow = Tokens('~user/workflow')

return_value = make_task_query(conn, workflow)
return_value = run_task_query(conn, workflow)

assert return_value[0]['count'] == 1
assert return_value[0]['cycle_point'] == '1'
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_make_task_query_2():
conn.commit()
workflow = Tokens('~user/workflow')

return_value = make_task_query(conn, workflow)
return_value = run_task_query(conn, workflow)

assert return_value[0]['count'] == 2
assert return_value[0]['cycle_point'] == '2'
Expand Down Expand Up @@ -167,7 +167,7 @@ def test_make_task_query_3():
conn.commit()
workflow = Tokens('~user/workflow')

return_value = make_task_query(conn, workflow)
return_value = run_task_query(conn, workflow)

assert len(return_value) == 1
assert return_value[0]['count'] == 3
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_make_jobs_query_1():
workflow = Tokens('~user/workflow')
tasks = []

return_value = make_jobs_query(conn, workflow, tasks)
return_value = run_jobs_query(conn, workflow, tasks)

assert len(return_value) == 3

Expand Down

0 comments on commit fcfb430

Please sign in to comment.