

def test_work(self):
    mocked_queue = MagicMock()
    mocked_idle = MagicMock(side_effect=ValueError)
    mocked_queue.get.side_effect = Empty()
    worker = SyncWorker('name', 'email', 'name', 'email', strategy='strategy', commit_queue=mocked_queue)
    worker.on_idle = mocked_idle
    worker.timeout = 1
    worker.min_idle_times = 1
    with pytest.raises(ValueError):
        worker.work()
    worker.get.assert_called_once_with(timeout=1, block=True)
    assert (mocked_idle.call_count == 1)

dataset/ETHPy150Open PressLabs/gitfs/tests/workers/test_sync.py TestSyncWorker.test_work/VarMisuse@91/130 `mocked_queue`->`worker`