async def METHOD_NAME(
    write_client,
):
    m = mapping.AsyncMapping()
    m.field(
        "name", "text", analyzer=analysis.analyzer("my_analyzer", tokenizer="keyword")
    )
    await write_client.indices.create(index="test-mapping")
    with raises(exceptions.IllegalOperation):
        await m.save("test-mapping", using=write_client)
    await write_client.cluster.health(index="test-mapping", wait_for_status="yellow")
    await write_client.indices.close(index="test-mapping")
    await m.save("test-mapping", using=write_client)
    assert {
        "test-mapping": {
            "mappings": {
                "properties": {"name": {"type": "text", "analyzer": "my_analyzer"}}
            }
        }
    } == await write_client.indices.get_mapping(index="test-mapping")