This repository has been archived on 2023-02-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
flamenco-worker/tests/test_coro_mock.py
Sybren A. Stüvel 4d9819c92f Removed Flamenco Server and Manager, and moved Worker to top level
This is a clone of the Flamenco repository from back in the days when
Server, Manager and Worker shared the same Git repository. This is the
commit where that ended, and they went their separate ways.
2017-03-03 16:13:09 +01:00

22 lines
538 B
Python

"""Unit test for our CoroMock implementation."""
import asyncio
import unittest
class CoroMockTest(unittest.TestCase):
def setUp(self):
from flamenco_worker.cli import construct_asyncio_loop
self.loop = construct_asyncio_loop()
def test_setting_return_value(self):
from mock_responses import CoroMock
cm = CoroMock()
cm.coro.return_value = '123'
result = self.loop.run_until_complete(cm(3, 4))
cm.assert_called_once_with(3, 4)
self.assertEqual('123', result)