Parent: [e1b8d5] (diff)

Child: [dcb73d] (diff)

Download this file

test_monq.py    25 lines (20 with data), 633 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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, (dict(a=5, b=6),))
ThreadLocalORMSession.flush_all()
ThreadLocalORMSession.close_all()
task = M.MonQTask.get()
assert task
task()
assert task.result == "{'a': 5, 'b': 6}", task.result