def METHOD_NAME(fake_qtile, patched_widget, fake_window):
    MockSpawn.call_count = 1
    kbd = patched_widget.KeyboardKbdd(
        configured_keyboards=["gb", "us"], colours=["#ff0000", "#00ff00"]
    )
    fakebar = FakeBar([kbd], window=fake_window)
    kbd._configure(fake_qtile, fakebar)
    # Create a message with the index of the active keyboard
    message = MockMessage(body=0)
    kbd._signal_received(message)
    assert kbd.layout.colour == "#ff0000"
    # Create a message with the index of the active keyboard
    message = MockMessage(body=1)
    kbd._signal_received(message)
    assert kbd.layout.colour == "#00ff00"
    # No change where self.colours is a string
    kbd.colours = "#ffff00"
    kbd._set_colour(1)
    assert kbd.layout.colour == "#00ff00"
    # Colours list is shorter than length of layouts
    kbd.colours = ["#ff00ff"]
    # Should pick second item in colours list but it doesn't exit
    # so widget looks for previous item
    kbd._set_colour(1)
    assert kbd.layout.colour == "#ff00ff"