Child: [ddf08c] (diff)

Download this file

test_monq.py    24 lines (19 with data), 606 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pprint
from nose.tools import with_setup
from ming.orm import ThreadLocalORMSession
from alluratest.controller import setup_basic_test, setup_global_objects
from allura import model as M
def setUp():
setup_basic_test()
ThreadLocalORMSession.close_all()
setup_global_objects()
M.MonQTask.query.remove({})
@with_setup(setUp)
def test_basic_task():
task = M.MonQTask.post(pprint.pformat, ([5,6],))
ThreadLocalORMSession.flush_all()
ThreadLocalORMSession.close_all()
task = M.MonQTask.get()
assert task
task()
assert task.result == 'I[5, 6]', task.result