# Path: wokkel/generic.py
# IQ_GET = '/iq[@type="get"]'
# IQ_SET = '/iq[@type="set"]'
# NS_VERSION = 'jabber:iq:version'
# VERSION = IQ_GET + '/query[@xmlns="' + NS_VERSION + '"]'
# def parseXml(string):
# def stripNamespace(rootElement):
#     def strip(element):
#     def connectionInitialized(self):
#     def iqFallback(self, iq):
#     def __init__(self, name, version):
#     def connectionInitialized(self):
#     def onVersion(self, iq):
#     def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
#     def getDiscoItems(self, requestor, target, nodeIdentifier=''):
#     def __init__(self):
#     def __init__(self, recipient=None, sender=None):
#     def fromElement(Class, element):
#     def parseElement(self, element):
#     def toElement(self):
#     def parseElement(self, element):
#     def __init__(self, recipient=None, sender=None, stanzaType=None):
#     def parseRequest(self, element):
#     def toElement(self):
#     def __init__(self, authenticator):
#     def buildProtocol(self, addr):
#     def clientConnectionFailed(self, connector, reason):
# def prepareIDNName(name):
# class FallbackHandler(XMPPHandler):
# class VersionHandler(XMPPHandler):
# class XmlPipe(object):
# class Stanza(object):
# class ErrorStanza(Stanza):
# class Request(Stanza):
# class DeferredXmlStreamFactory(BootstrapMixin, protocol.ClientFactory):
# 
# Path: wokkel/subprotocols.py
# class XMPPHandler(object):
# class StreamManager(XMPPHandlerCollection):
# class IQHandlerMixin(object):
#     def __init__(self):
#     def setHandlerParent(self, parent):
#     def disownHandlerParent(self, parent):
#     def makeConnection(self, xs):
#     def connectionMade(self):
#     def connectionInitialized(self):
#     def connectionLost(self, reason):
#     def send(self, obj):
#     def request(self, request):
#     def __init__(self, factory, reactor=None):
#     def addHandler(self, handler):
#     def _connected(self, xs):
#         def logDataIn(buf):
#         def logDataOut(buf):
#     def _authd(self, xs):
#     def initializationFailed(self, reason):
#     def _disconnected(self, reason):
#     def _onIQResponse(self, iq):
#     def send(self, obj):
#     def request(self, request):
#             def onTimeout():
#             def cancelTimeout(result):
#     def handleRequest(self, iq):
#         def toResult(result, iq):
#         def checkNotImplemented(failure):
#         def fromStanzaError(failure, iq):
#         def fromOtherError(failure, iq):


from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, task
from twisted.internet.error import ConnectionDone
from twisted.python import failure
from twisted.words.xish import domish
from twisted.words.protocols.jabber import error, ijabber, xmlstream
from wokkel import generic, subprotocols
        from wokkel.subprotocols import XMPPHandlerCollection
        return d


    def test_requestNotIQ(self):
        """
        The request stanza must be an iq.
        """
        stanza = generic.Stanza()
        stanza.stanzaKind = 'message'

        d = self.streamManager.request(stanza)
        self.assertFailure(d, ValueError)


    def test_requestNotResult(self):
        """
        The request stanza cannot be of type 'result'.
        """
        stanza = generic.Stanza()
        stanza.stanzaKind = 'iq'
        stanza.stanzaType = 'result'

        d = self.streamManager.request(stanza)
        self.assertFailure(d, ValueError)


    def test_requestNotError(self):
        """
        The request stanza cannot be of type 'error'.
        """

# Path: wokkel/generic.py
# IQ_GET = '/iq[@type="get"]'
# IQ_SET = '/iq[@type="set"]'
# NS_VERSION = 'jabber:iq:version'
# VERSION = IQ_GET + '/query[@xmlns="' + NS_VERSION + '"]'
# def parseXml(string):
# def stripNamespace(rootElement):
#     def strip(element):
#     def connectionInitialized(self):
#     def iqFallback(self, iq):
#     def __init__(self, name, version):
#     def connectionInitialized(self):
#     def onVersion(self, iq):
#     def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
#     def getDiscoItems(self, requestor, target, nodeIdentifier=''):
#     def __init__(self):
#     def __init__(self, recipient=None, sender=None):
#     def fromElement(Class, element):
#     def parseElement(self, element):
#     def toElement(self):
#     def parseElement(self, element):
#     def __init__(self, recipient=None, sender=None, stanzaType=None):
#     def parseRequest(self, element):
#     def toElement(self):
#     def __init__(self, authenticator):
#     def buildProtocol(self, addr):
#     def clientConnectionFailed(self, connector, reason):
# def prepareIDNName(name):
# class FallbackHandler(XMPPHandler):
# class VersionHandler(XMPPHandler):
# class XmlPipe(object):
# class Stanza(object):
# class ErrorStanza(Stanza):
# class Request(Stanza):
# class DeferredXmlStreamFactory(BootstrapMixin, protocol.ClientFactory):
# 
# Path: wokkel/subprotocols.py
# class XMPPHandler(object):
# class StreamManager(XMPPHandlerCollection):
# class IQHandlerMixin(object):
#     def __init__(self):
#     def setHandlerParent(self, parent):
#     def disownHandlerParent(self, parent):
#     def makeConnection(self, xs):
#     def connectionMade(self):
#     def connectionInitialized(self):
#     def connectionLost(self, reason):
#     def send(self, obj):
#     def request(self, request):
#     def __init__(self, factory, reactor=None):
#     def addHandler(self, handler):
#     def _connected(self, xs):
#         def logDataIn(buf):
#         def logDataOut(buf):
#     def _authd(self, xs):
#     def initializationFailed(self, reason):
#     def _disconnected(self, reason):
#     def _onIQResponse(self, iq):
#     def send(self, obj):
#     def request(self, request):
#             def onTimeout():
#             def cancelTimeout(result):
#     def handleRequest(self, iq):
#         def toResult(result, iq):
#         def checkNotImplemented(failure):
#         def fromStanzaError(failure, iq):
#         def fromOtherError(failure, iq):


# Path: wokkel/test/test_subprotocols.py
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, task
from twisted.internet.error import ConnectionDone
from twisted.python import failure
from twisted.words.xish import domish
from twisted.words.protocols.jabber import error, ijabber, xmlstream
from wokkel import generic, subprotocols
        from wokkel.subprotocols import XMPPHandlerCollection

        return d


    def test_requestNotIQ(self):
        """
        The request stanza must be an iq.
        """
        stanza = generic.Stanza()
        stanza.stanzaKind = 'message'

        d = self.streamManager.request(stanza)
        self.assertFailure(d, ValueError)


    def test_requestNotResult(self):
        """
        The request stanza cannot be of type 'result'.
        """
        stanza = generic.Stanza()
        stanza.stanzaKind = 'iq'
        stanza.stanzaType = 'result'

        d = self.streamManager.request(stanza)
        self.assertFailure(d, ValueError)


    def test_requestNotError(self):
        """
        The request stanza cannot be of type 'error'.
        """

        stanza = generic.Stanza()