How to use the pottery.QuorumNotAchieved function in pottery

To help you get started, we’ve selected a few pottery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brainix / pottery / tests / test_nextid.py View on Github external
def test_next(self):
        with self.assertRaises(QuorumNotAchieved), \
             unittest.mock.patch.object(
                 next(iter(self.ids.masters)),
                 'get',
             ) as get:
            get.side_effect = TimeoutError
            next(self.ids)

        with self.assertRaises(QuorumNotAchieved), \
             unittest.mock.patch.object(
                 self.ids,
                 '_set_id_script',
             ) as _set_id_script:
            _set_id_script.side_effect = TimeoutError
            next(self.ids)
github brainix / pottery / tests / test_nextid.py View on Github external
def test_next(self):
        with self.assertRaises(QuorumNotAchieved), \
             unittest.mock.patch.object(
                 next(iter(self.ids.masters)),
                 'get',
             ) as get:
            get.side_effect = TimeoutError
            next(self.ids)

        with self.assertRaises(QuorumNotAchieved), \
             unittest.mock.patch.object(
                 self.ids,
                 '_set_id_script',
             ) as _set_id_script:
            _set_id_script.side_effect = TimeoutError
            next(self.ids)