Esempio n. 1
0
class TestPatroniSequentialThreadingHandler(unittest.TestCase):
    def setUp(self):
        self.handler = PatroniSequentialThreadingHandler(10)

    @patch.object(SequentialThreadingHandler, 'create_connection', Mock())
    def test_create_connection(self):
        self.assertIsNotNone(self.handler.create_connection(()))
        self.assertIsNotNone(self.handler.create_connection((), 40))
Esempio n. 2
0
class TestPatroniSequentialThreadingHandler(unittest.TestCase):

    def setUp(self):
        self.handler = PatroniSequentialThreadingHandler(10)

    @patch.object(SequentialThreadingHandler, 'create_connection', Mock())
    def test_create_connection(self):
        self.assertIsNotNone(self.handler.create_connection(()))
        self.assertIsNotNone(self.handler.create_connection((), 40))
Esempio n. 3
0
class TestPatroniSequentialThreadingHandler(unittest.TestCase):
    def setUp(self):
        self.handler = PatroniSequentialThreadingHandler(10)

    @patch.object(SequentialThreadingHandler, 'create_connection', Mock())
    def test_create_connection(self):
        self.assertIsNotNone(self.handler.create_connection(()))
        self.assertIsNotNone(self.handler.create_connection((), 40))
        self.assertIsNotNone(self.handler.create_connection(timeout=40))

    @patch.object(SequentialThreadingHandler, 'select',
                  Mock(side_effect=ValueError))
    def test_select(self):
        self.assertRaises(select.error, self.handler.select)
Esempio n. 4
0
 def setUp(self):
     self.handler = PatroniSequentialThreadingHandler(10)
Esempio n. 5
0
 def setUp(self):
     self.handler = PatroniSequentialThreadingHandler(10)