예제 #1
0
def test_connectable_master_random(mock_calculate_remote_masters, mock_find_connectable_master, mock_shuffle):
    masters = [
        '192.0.2.1',
        '192.0.2.2',
        '192.0.2.3',
    ]
    mock_calculate_remote_masters.return_value = (masters, None)
    mock_find_connectable_master.return_value = (masters[0], None)
    mock_shuffle.return_value = None

    utils.connectable_master("fake_cluster", SystemPaastaConfig({}, '/fake/config'))
    mock_shuffle.assert_called_once_with(masters)
예제 #2
0
def test_connectable_master_random(
    mock_calculate_remote_masters,
    mock_find_connectable_master,
    mock_shuffle,
    system_paasta_config,
):
    masters = ["192.0.2.1", "192.0.2.2", "192.0.2.3"]
    mock_calculate_remote_masters.return_value = (masters, None)
    mock_find_connectable_master.return_value = (masters[0], None)
    mock_shuffle.return_value = None

    utils.connectable_master("fake_cluster", system_paasta_config)
    mock_shuffle.assert_called_once_with(masters)