def add_handle(self, handle): if not isinstance(handle, MockCurl): raise AssertionError("Only MockCurl objects are allowed") if handle in self._handle_list: # same error as real CurlMulti object raise pycurl.error("curl object already on this multi-stack") self._handle_list.append(handle)
def remove_handle(self, handle): if handle not in self._handle_list: # same error as real CurlMulti object raise pycurl.error("curl object not on this multi-stack") self._handle_list.remove(handle)