示例#1
0
    def test_iterator_should_return_an_interator_with_all_backends_instances(
        self, configured_pools
    ):
        backends = BackendPool.iterator()
        assert isinstance(backends, Iterator)

        backend_0 = next(backends)
        backend_1 = next(backends)

        assert isinstance(backend_0, FakeXYZBackend)
        assert isinstance(backend_1, FakeABCBackend)
示例#2
0
    def test_iterator_should_return_an_interator_with_all_backends_instances(
            self):
        configure(
            pools={
                BackendPool.backend_type: (
                    u'{module}.{cls}'.format(module=__name__,
                                             cls=FakeXYZBackend.__name__),
                    u'{module}.{cls}'.format(module=__name__,
                                             cls=FakeABCBackend.__name__),
                )
            })

        backends = BackendPool.iterator()
        assert isinstance(backends, Iterator)

        backend_0 = next(backends)
        backend_1 = next(backends)

        assert isinstance(backend_0, FakeXYZBackend)
        assert isinstance(backend_1, FakeABCBackend)