Commit f7a13b92 authored by Martin Schorb's avatar Martin Schorb
Browse files

test findactivejob

parent 7659b331
......@@ -10,7 +10,7 @@ import os
import subprocess
import dash
import params
from dashUI import params
import time
import datetime
import psutil
......@@ -415,6 +415,9 @@ def find_activejob(run_state):
:return: single JobID, path to associated log file
"""
if 'seq' not in run_state['id'].keys():
raise TypeError('Jobs need to be sequential!')
for idx, job in enumerate(run_state['id']['seq']):
thisstate = run_state.copy()
thisstate['id'] = job
......
......@@ -7,6 +7,10 @@ import os
import pytest
from dashUI.utils.launch_jobs import *
run_state0 = dict(status='',
type='standalone',
logfile='log.log',
id=0)
# test conversion of argstrings
def test_args2string():
......@@ -29,4 +33,16 @@ def test_args2string():
# test status of local tasks
def test_status():
def test_find_activejob():
rs1 = dict(run_state0)
rs1['id'] = {'par':[1,2,3,4]}
rs1['status'] = ['done','running','done','pending']
# check for sequential jobs
with pytest.raises(TypeError):
find_activejob(rs1)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment