komuw / wiji

Wiji is an asyncio distributed task processor/queue.
MIT License
4 stars 1 forks source link

async mock should return the mocked object not a proxy to it #78

Open komuw opened 5 years ago

komuw commented 5 years ago

currently you need to do: https://github.com/komuw/wiji/blob/80a3aafc6d098cc7af7e08d8ebdea7d55cef50b0/tests/test_worker.py#L179-L188

mock_dequeue.mock.return_value = json.dumps(item)

self.assertTrue(mock_dequeue.mock.called)

Instead we should be able to write:

mock_dequeue.return_value = json.dumps(item)

self.assertTrue(mock_dequeue.called)