def test_wait_for_stable_cluster_success(mock_sleep, mock_read): main.wait_for_stable_cluster([], 1, "", 5, 3, 100) assert mock_read.call_count == 6 assert mock_sleep.mock_calls == [mock.call(5)] * 5
def test_wait_for_stable_cluster_success(mock_sleep, mock_read): main.wait_for_stable_cluster([], 1, "", 5, 3, 100) assert mock_read.call_count == 6 assert mock_sleep.mock_calls == [mock.call(5)] * 5
def test_wait_for_stable_cluster_timeout(mock_sleep, mock_read): with pytest.raises(main.WaitTimeoutException): main.wait_for_stable_cluster([], 1, "", 5, 3, 100) assert mock_read.call_count == 21 assert mock_sleep.mock_calls == [mock.call(5)] * 20
def test_wait_for_stable_cluster_timeout(mock_sleep, mock_read): with pytest.raises(main.WaitTimeoutException): main.wait_for_stable_cluster([], 1, "", 5, 3, 100) assert mock_read.call_count == 21 assert mock_sleep.mock_calls == [mock.call(5)] * 20