def setUp(self): self.protocol = MongoProtocol() self.query = _MongoQuery(0, 'foobar', 5) # A query has been sent, so id is different from the one in the query self.protocol._MongoProtocol__id = 1 self.protocol._MongoProtocol__queries[self.query.id] = self.query self.protocol.transport = StringTransport()
def setUp(self): self.protocol = MongoProtocol() self.cursor = MongoCursor(0, 'foobar', 5, self.protocol) # A query has been sent, so id is different from the one in the query self.protocol._MongoProtocol__id = 1 self.protocol._MongoProtocol__queries[ self.cursor.request_id] = self.cursor self.protocol.transport = StringTransport()