Beispiel #1
0
def test_simplify_string():
    events = [
        Event(data={"label": "(99) Facebook"}),
        Event(data={"label": "(14) YouTube"}),
    ]
    assert simplify_string(events, "label")[0].data["label"] == "Facebook"
    assert simplify_string(events, "label")[1].data["label"] == "YouTube"

    events = [
        Event(data={
            "app": "Cemu.exe",
            "title": "Cemu - FPS: 133.7 - BotW"
        })
    ]
    assert simplify_string(
        events, "title")[0].data["title"] == "Cemu - FPS: ... - BotW"

    events = [
        Event(data={
            "app": "VSCode.exe",
            "title": "● report.md - Visual Studio Code"
        })
    ]
    assert simplify_string(
        events, "title")[0].data["title"] == "report.md - Visual Studio Code"

    events = [Event(data={"app": "Gedit", "title": "*test.md - gedit"})]
    assert simplify_string(events,
                           "title")[0].data["title"] == "test.md - gedit"
def test_simplify_string():
    events = [
        Event(data={"label": "(99) Facebook"}),
        Event(data={"label": "(14) YouTube"}),
    ]
    assert simplify_string(events, "label")[0].data["label"] == "Facebook"
    assert simplify_string(events, "label")[1].data["label"] == "YouTube"

    events = [Event(data={"app": "Cemu.exe", "title": "Cemu - FPS: 133.7 - BotW"})]
    assert simplify_string(events, "title")[0].data["title"] == "Cemu - FPS: ... - BotW"

    events = [Event(data={"app": "VSCode.exe", "title": "● report.md - Visual Studio Code"})]
    assert simplify_string(events, "title")[0].data["title"] == "report.md - Visual Studio Code"

    events = [Event(data={"app": "Gedit", "title": "*test.md - gedit"})]
    assert simplify_string(events, "title")[0].data["title"] == "test.md - gedit"
Beispiel #3
0
def q2_simplify_window_titles(events: list, key: str) -> List[Event]:
    return simplify_string(events, key=key)
def q2_simplify_window_titles(events: list, key: str) -> List[Event]:
    _verify_variable_is_type(events, list)
    _verify_variable_is_type(key, str)
    return simplify_string(events, key=key)
Beispiel #5
0
def q2_simplify_window_titles(events: list, key: str) -> List[Event]:
    _verify_variable_is_type(events, list)
    _verify_variable_is_type(key, str)
    return simplify_string(events, key=key)