def test_selector_from_encoded():
    """Make sure we can create a selector from an encoded value."""

    sel = DataStreamSelector.FromEncoded(0x5FFF)
    assert str(sel) == 'all system outputs'

    sel = DataStreamSelector.FromEncoded(0xD7FF)
    assert str(sel) == 'all outputs'

    sel = DataStreamSelector.FromEncoded(0x100a)
    assert str(sel) == 'unbuffered 10'

    assert str(DataStreamSelector.FromEncoded(DataStreamSelector.FromString('all combined output').encode())) == 'all combined outputs'