add missing tests for async_executor

This commit is contained in:
Alexander Kukushkin
2015-10-09 16:02:34 +02:00
parent a588ddc23c
commit cf6be5f58e
+18
View File
@@ -0,0 +1,18 @@
import unittest
from mock import Mock, patch
from patroni.async_executor import AsyncExecutor
from threading import Thread
class TestAsyncExecutor(unittest.TestCase):
def setUp(self):
self.a = AsyncExecutor()
@patch.object(Thread, 'start', Mock())
def test_run_async(self):
self.a.run_async(Mock(return_value=True))
def test_run(self):
self.a.run(Mock(side_effect=Exception()))