def test_get_regions_wrong_pool():
    with mock.patch(
            "paasta_tools.paasta_cluster_boost.load_system_paasta_config",
            autospec=True) as load_system_paasta_config_patch:
        load_system_paasta_config_patch.return_value.get_expected_slave_attributes = mock.Mock(
            return_value=FAKE_SLAVE_DATA)
        assert paasta_cluster_boost.get_regions("piscine") == []
コード例 #2
0
def test_get_regions():
    with mock.patch(
            'paasta_tools.paasta_cluster_boost.load_system_paasta_config',
            autospec=True,
    ) as load_system_paasta_config_patch:
        load_system_paasta_config_patch.return_value.get_expected_slave_attributes = mock.Mock(
            return_value=FAKE_SLAVE_DATA, )
        assert paasta_cluster_boost.get_regions('default') == ['westeros-1']