'Test sendStreamError on an initiating xmlstream without having sent a
header.
In this case, no header should be generated. Also, the error should
not be sent out on the stream. Just closing the connection.'

def test_sendStreamErrorInitiatingNoHeader(self):

    xs = self.xmlstream
    xs.initiating = True
    xs.transport.clear()
    xs.sendStreamError(error.StreamError('version-unsupported'))
    self.assertNot(xs._headerSent)
    self.assertEqual('', xs.transport.value())
    self.assertTrue(self.gotStreamEnd)
