Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)