Example #1
0
def test_filter_control():
    control_code = (ControlType.HOME, 0)
    segments = [Segment("foo"), Segment("bar", None, (control_code,))]
    assert list(Segment.filter_control(segments)) == [Segment("foo")]
    assert list(Segment.filter_control(segments, is_control=True)) == [
        Segment("bar", None, (control_code,))
    ]
Example #2
0
def test_filter_control():
    segments = [Segment("foo"), Segment("bar", is_control=True)]
    assert list(Segment.filter_control(segments)) == [Segment("foo")]
    assert list(Segment.filter_control(
        segments, is_control=True)) == [Segment("bar", is_control=True)]