'L{TuntapPort.loseConnection} stops the port and is deprecated.'

def test_loseConnection(self):

    self.port.startListening()
    self.port.loseConnection()
    self.reactor.advance(0)
    self.assertFalse(self.port.connected)
    warnings = self.flushWarnings([self.test_loseConnection])
    self.assertEqual(DeprecationWarning, warnings[0]['category'])
    self.assertEqual('twisted.pair.tuntap.TuntapPort.loseConnection    was    deprecated    in    Twisted    14.0.0;    please    use    twisted.pair.tuntap.TuntapPort.stopListening    instead', warnings[0]['message'])
    self.assertEqual(1, len(warnings))
