コード例 #1
0
ファイル: root.py プロジェクト: fvukelic/flocx-market
    def addprotocol(self, protocol, **options):
        """
        Enable a new protocol on the controller.

        :param protocol: A registered protocol name or an instance
                         of a protocol.
        """
        if isinstance(protocol, str):
            protocol = getprotocol(protocol, **options)
        self.protocols.append(protocol)
        protocol.root = weakref.proxy(self)
コード例 #2
0
ファイル: root.py プロジェクト: LonelyWhale/openstackDemo
    def addprotocol(self, protocol, **options):
        """
        Enable a new protocol on the controller.

        :param protocol: A registered protocol name or an instance
                         of a protocol.
        """
        if isinstance(protocol, str):
            protocol = getprotocol(protocol, **options)
        self.protocols.append(protocol)
        protocol.root = weakref.proxy(self)
コード例 #3
0
def test_getprotocol():
    try:
        getprotocol("invalid")
        assert False, "ValueError was not raised"
    except ValueError:
        pass
コード例 #4
0
def test_getprotocol():
    try:
        getprotocol('invalid')
        assert False, "ValueError was not raised"
    except ValueError:
        pass