'Fake C{os.fdopen}. Return a file-like object whose content can
be tested later via C{self.fdio}.'

def fdopen(self, fd, flag):

    if (flag == 'wb'):
        self.fdio = BytesIO()
    else:
        assert False
    return self.fdio
