def test_j4dmenu_configuration_options():
    """
    Test that configuration options are correctly translated into
    command options for dmenu.
    """
    _Extension.global_defaults = {}

    opts = [
        ({}, ["j4-dmenu-desktop", "--dmenu"]),
        ({"font": "testfont"}, ["dmenu -fn testfont"]),  # Dmenu settings are applied too
        ({"j4dmenu_use_xdg_de": True}, ["--use-xdg-de"]),
        ({"j4dmenu_display_binary": True}, ["--display-binary"]),
        ({"j4dmenu_generic": False}, ["--no-generic"]),
        ({"j4dmenu_terminal": "testterminal"}, ["--term", "testterminal"]),
        ({"j4dmenu_usage_log": "testlog"}, ["--usage-log", "testlog"]),
    ]

    # Loop over options, create an instance of J4DmenuDesktop with the provided "config"
    # find the index of the first item in "output" and check any following items
    # match the expected output
    for config, output in opts:
        extension = J4DmenuDesktop(**config)
        extension._configure(None)
        index = extension.configured_command.index(output[0])
        assert output == extension.configured_command[index : index + len(output)]

    Test that configuration options are correctly translated into
    command options for dmenu.
    
test/extension/test_dmenu.py