def METHOD_NAME(self):
    """Test download file from a gated repo fails with correct message when not authenticated."""
    with self.assertRaisesRegex(EnvironmentError, "You are trying to access a gated repo."):
        cached_file(GATED_REPO, README_FILE, use_auth_token=False)