async def METHOD_NAME(
    groups, mongo, kings, all_permissions, no_permissions
):
    await mongo.groups.insert_many([kings], session=None)
    coroutine = compose_groups_update(mongo, groups)
    if groups == ["kings", "peasants"]:
        with pytest.raises(virtool.errors.DatabaseError) as excinfo:
            await coroutine
        assert "Non-existent groups: peasants" in str(excinfo.value)
        return
    update = await coroutine
    if groups is None:
        assert update == {}
    else:
        assert update == {
            "groups": groups,
        }