Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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
Beispiel #4
0
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