def testCreateDataPipeWithIncorrectParameters(self): options = system.CreateDataPipeOptions() options.element_num_bytes = 5 options.capacity_num_bytes = DATA_SIZE with self.assertRaises(system.MojoException) as cm: self._TestDataHandleCreation(system.DataPipe(options)) self.assertEquals(system.RESULT_INVALID_ARGUMENT, cm.exception.mojo_result)
def testCreateDataPipeWithCapacity(self): options = system.CreateDataPipeOptions() options.element_capacity_num_bytes = DATA_SIZE self._TestDataHandleCreation(system.DataPipe(options))
def testCreateDataPipeWithElementSize(self): options = system.CreateDataPipeOptions() options.element_num_bytes = 5 self._TestDataHandleCreation(system.DataPipe(options))
def testCreateDataPipeWithDiscardFlag(self): options = system.CreateDataPipeOptions() options.flags = system.CreateDataPipeOptions.FLAG_MAY_DISCARD self._TestDataHandleCreation(system.DataPipe(options))
def testCreateDataPipeWithDefaultOptions(self): self._TestDataHandleCreation( system.DataPipe(system.CreateDataPipeOptions()))