Example #1
0
    def test_get_allowed_exmods(self):
        rpc.ALLOWED_EXMODS = ['foo']
        rpc.EXTRA_EXMODS = ['bar']

        exmods = rpc.get_allowed_exmods()

        self.assertEqual(['foo', 'bar'], exmods)
Example #2
0
    def test_get_allowed_exmods(self):
        rpc.ALLOWED_EXMODS = ['foo']
        rpc.EXTRA_EXMODS = ['bar']

        exmods = rpc.get_allowed_exmods()

        self.assertEqual(['foo', 'bar'], exmods)
Example #3
0
    def test_get_allowed_exmods(self):
        rpc.ALLOWED_EXMODS = ["foo"]
        rpc.EXTRA_EXMODS = ["bar"]

        exmods = rpc.get_allowed_exmods()

        self.assertEqual(["foo", "bar"], exmods)
Example #4
0
    def test_get_allowed_exmods(self):
        allowed_exmods = ['foo']
        extra_exmods = ['bar']

        with test.nested(
                mock.patch.object(rpc, 'EXTRA_EXMODS', extra_exmods),
                mock.patch.object(rpc, 'ALLOWED_EXMODS', allowed_exmods)
                ) as (mock_EXTRA_EXMODS, mock_ALLOWED_EXMODS):
            exmods = rpc.get_allowed_exmods()

        self.assertEqual(['foo', 'bar'], exmods)
Example #5
0
    def _fake_create_transport(self, url):
        # FIXME(danms): Right now, collapse all connections
        # to a single bus. This is how our tests expect things
        # to work. When the tests are fixed, this fixture can
        # support simulating multiple independent buses, and this
        # hack should be removed.
        url = None

        # NOTE(danms): This will be called with a non-None url by
        # cells-aware code that is requesting to contact something on
        # one of the many transports we're multplexing here.
        if url not in self._buses:
            exmods = rpc.get_allowed_exmods()
            self._buses[url] = messaging.get_transport(
                CONF,
                url=url,
                allowed_remote_exmods=exmods)
        return self._buses[url]
Example #6
0
    def _fake_create_transport(self, url):
        # FIXME(danms): Right now, collapse all connections
        # to a single bus. This is how our tests expect things
        # to work. When the tests are fixed, this fixture can
        # support simulating multiple independent buses, and this
        # hack should be removed.
        url = None

        # NOTE(danms): This will be called with a non-None url by
        # cells-aware code that is requesting to contact something on
        # one of the many transports we're multplexing here.
        if url not in self._buses:
            exmods = rpc.get_allowed_exmods()
            self._buses[url] = messaging.get_transport(
                CONF,
                url=url,
                allowed_remote_exmods=exmods,
                aliases=rpc.TRANSPORT_ALIASES)
        return self._buses[url]