def METHOD_NAME(self):
    bad_index_url = 'http://contoso.com/cli-index'
    with mock.patch('requests.get', side_effect=mock_index_get_generator(DEFAULT_INDEX_URL, {})):
        with self.assertRaises(CLIError) as err:
            get_index(index_url=bad_index_url)
        self.assertEqual(str(err.exception), ERR_TMPL_NON_200.format(404, bad_index_url))