def test_init_with_default_region_not_found(self, mock_add_regional_client): test = KMSMasterKeyProvider(botocore_session=self.botocore_no_region_session) assert test.default_region is None with patch.object(test.config.botocore_session, "get_config_variable", return_value=None) as mock_get_config: test._process_config() mock_get_config.assert_called_once_with("region") assert test.default_region is None assert not mock_add_regional_client.called
def test_init_with_default_region_found(self, mock_add_regional_client): test = KMSMasterKeyProvider() assert test.default_region is None with patch.object( test.config.botocore_session, 'get_config_variable', return_value=sentinel.default_region) as mock_get_config: test._process_config() mock_get_config.assert_called_once_with('region') assert test.default_region is sentinel.default_region mock_add_regional_client.assert_called_once_with( sentinel.default_region)