'Test correct positional and keyword arguments have been
passed to the C{serial.Serial} object.'

def test_serialPortDefaultArgs(self):

    port = RegularFileSerialPort(self.protocol, self.path, self.reactor)
    self.assertEqual((self.path,), port._serial.captured_args)
    kwargs = port._serial.captured_kwargs
    self.assertEqual(9600, kwargs['baudrate'])
    self.assertEqual(serial.EIGHTBITS, kwargs['bytesize'])
    self.assertEqual(serial.PARITY_NONE, kwargs['parity'])
    self.assertEqual(serial.STOPBITS_ONE, kwargs['stopbits'])
    self.assertEqual(0, kwargs['xonxoff'])
    self.assertEqual(0, kwargs['rtscts'])
    self.assertEqual(None, kwargs['timeout'])
    port.connectionLost(Failure(Exception('Cleanup')))
