def test_command_set_valid_command(caplog, fake_qtile):
    """Extension should run pre-commands and selected command."""
    extension = CommandSet(pre_commands=["run pre-command"], commands={"key": "run testcommand"})
    extension._configure(fake_qtile)
    extension.run()

    assert caplog.record_tuples == [
        ("libqtile", logging.WARNING, "run pre-command"),
        ("libqtile", logging.WARNING, "run testcommand"),
    ]
Extension should run pre-commands and selected command.
test/extension/test_command_set.py