mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Watchdog unit-tests, bugfixes and questions (#449)
Implement missing unit-tests for and drop unused code
This commit is contained in:
committed by
GitHub
parent
0b2134aba3
commit
acc6d7c2c2
@@ -1,7 +1,7 @@
|
||||
import unittest
|
||||
|
||||
from mock import Mock, patch
|
||||
from patroni.async_executor import AsyncExecutor
|
||||
from patroni.async_executor import AsyncExecutor, CriticalTask
|
||||
from threading import Thread
|
||||
|
||||
|
||||
@@ -16,3 +16,11 @@ class TestAsyncExecutor(unittest.TestCase):
|
||||
|
||||
def test_run(self):
|
||||
self.a.run(Mock(side_effect=Exception()))
|
||||
|
||||
|
||||
class TestCriticalTask(unittest.TestCase):
|
||||
|
||||
def test_completed_task(self):
|
||||
ct = CriticalTask()
|
||||
ct.complete(1)
|
||||
self.assertFalse(ct.cancel())
|
||||
|
||||
Reference in New Issue
Block a user