コード例 #1
0
def test_push_task():

    ac = flexmock()

    ac.should_receive('list').and_return(defer.succeed(['foo', 'bar'])).once()

    def configure(binder):
        binder.bind(ApplicationController, ac)

    with inject_services(configure):

        ts = TaskService()

        r = yield ts.task_list(123123)
        assert r == ['foo', 'bar']
コード例 #2
0
ファイル: test_tasks.py プロジェクト: hydface2/mcloud
def test_push_task():

    ac = flexmock()

    ac.should_receive('list').and_return(defer.succeed(['foo', 'bar'])).once()

    def configure(binder):
        binder.bind(ApplicationController, ac)

    with inject_services(configure):

        ts = TaskService()

        r = yield ts.task_list(123123)
        assert r == ['foo', 'bar']