def __init__(self, initial_value=None): if initial_value is not None: self._buffer = api.new('char[]', initial_value) bio = api.BIO_new_mem_buf(self._buffer, len(initial_value)) else: bio = api.BIO_new(api.BIO_s_mem()) super(BIOMemBuffer, self).__init__(bio)
def setUp(self): self.fileobj = io.BIONull() self.filter = api.BIO_new(api.BIO_f_null()) self.sink = self.fileobj.c_bio self.fileobj.push(self.filter) self.bio = self.fileobj.c_bio
def __init__(self): bio = api.BIO_new(api.BIO_s_null()) super(BIONull, self).__init__(bio)
def setUp(self): self.filter = api.BIO_new(api.BIO_f_null()) self.sink = api.BIO_new(api.BIO_s_mem()) self.bio = api.BIO_push(self.filter, self.sink) self.fileobj = io.BIOChain(self.bio)
def setUp(self): self.buff = api.new('char[]', self.DATA) self.filter = api.BIO_new(api.BIO_f_null()) self.sink = api.BIO_new_mem_buf(self.buff, len(self.DATA)) self.bio = api.BIO_push(self.filter, self.sink) self.fileobj = io.BIOChain(self.bio)