def test_room_filter():
    filtered_talk = filter_talk(test_flat_talks[0],
                                conference="32c3",
                                room="Hall 1")
    filtered_talk_2 = filter_talk(test_flat_talks[0],
                                  conference="32c3",
                                  room="Hall 10")
    assert filtered_talk is True and filtered_talk_2 is False
def test_title_filter():
    filtered_talk = filter_talk(test_flat_talks[0],
                                conference="32c3",
                                title="OPENIng")
    filtered_talk_2 = filter_talk(test_flat_talks[0],
                                  conference="32c3",
                                  speaker="0p3N!ng")
    assert filtered_talk is True and filtered_talk_2 is False
def test_start_filter():
    filtered_talk = filter_talk(test_flat_talks[0],
                                conference="32c3",
                                start="11:00")
    filtered_talk_2 = filter_talk(test_flat_talks[0],
                                  conference="32c3",
                                  start="12:00")
    assert filtered_talk is True and filtered_talk_2 is False
def test_speaker_filter():
    filtered_talk = filter_talk(test_flat_talks[0],
                                conference="32c3",
                                speaker="CaRiNa")
    filtered_talk_2 = filter_talk(test_flat_talks[0],
                                  conference="32c3",
                                  speaker="CaRiNa2")
    assert filtered_talk is True and filtered_talk_2 is False
def test_filter_past_filter():
    filtered_talk = filter_talk(test_flat_talks[0],
                                conference="32c3",
                                filter_past=False)
    filtered_talk_2 = filter_talk(test_flat_talks[0],
                                  conference="32c3",
                                  filter_past=True)
    assert filtered_talk is True and filtered_talk_2 is False
def cli(
    speaker,
    title,
    track,
    day,
    start: dt.datetime,
    room,
    show_abstract,
    show_description,
    conference,
    sort,
    reverse,
    update_cache,
    no_past,
):
    now = dt.datetime.now().astimezone()
    start = None if start is None else f"{start.hour}:{start.minute}"
    matching_talks = [
        x for x in Fahrplan(update_cache=update_cache).flat_plans
        if filter_talk(x, speaker, title, track, day, start, room, conference,
                       no_past, now)
    ]
    print_formatted_talks(
        matching_talks,
        show_abstract,
        show_description,
        sort_by=sort,
        reverse=reverse,
    )
def test_day_filter():
    filtered_talk = filter_talk(test_flat_talks[0], conference="32c3", day=0)
    filtered_talk_2 = filter_talk(test_flat_talks[0], conference="32c3", day=5)
    assert filtered_talk is True and filtered_talk_2 is False
def test_conference_filter():
    filtered_talk = filter_talk(test_flat_talks[0], conference="32c3")
    filtered_talk_2 = filter_talk(test_flat_talks[0], conference="rc")
    assert filtered_talk is True and filtered_talk_2 is False