def test_explicit_mapper(
            self,
            key,
            from_config,
            config,
            process_mapper_cls,
            thread_mapper_cls,
            default_batcher,
        ):
            """test create with explicit mapper key"""

            if from_config:
                config.default_parallelization_method = key

            mapper_classes = [process_mapper_cls, thread_mapper_cls]
            expected_mapper_cls = None
            if key == "process":
                expected_mapper_cls = process_mapper_cls
            elif key == "thread":
                expected_mapper_cls = thread_mapper_cls

            #####
            result = fomf.MapperFactory.create(
                key if not from_config else None,
                num_workers := mock.Mock(),
                batch_size=(batch_size := mock.Mock()),
                **(kwargs := mock.create_autospec(dict)),
            )
            #####

            for mapper_cls in mapper_classes:
                if mapper_cls is not expected_mapper_cls:
                    assert not mapper_cls.create.called

            expected_mapper_cls.create.assert_called_once_with(
                config=config,
                batch_cls=default_batcher,
                batch_size=batch_size,
                num_workers=num_workers,
                **kwargs,
            )

            assert result == expected_mapper_cls.create.return_value
test create with explicit mapper key
tests/unittests/map/test_factory.py