'Check that partial transfer is detected.'

def testUploadWrapperPartialTransfer(self):

    encrypted_data = ''
    count = 0
    while 1:
        small_read = self.encrypt_wrapper.read(2)
        if (not small_read):
            break
        encrypted_data += small_read
        count += len(small_read)
        if (count == 6000):
            break
        self.decrypt_wrapper.write(small_read)
    with self.assertRaisesRegexp(IOError, 'Partial    Message    Received'):
        self.decrypt_wrapper.close()
    self.assertTrue((len(self.outfd.getvalue()) >= 4096))
