def test_extractContentWithManyReplacementMarkers():
    telegram = bytes([0xAA, 0xCC, 0xCC, 0xCC, 0xCC, 0x00, 0xBB])
    content = _TelegramFrameParser.extractContent(telegram)
    assert content == bytes([0x04])
def test_extractContentWithUnresolvableReplacementMarker():
    telegram = bytes([0xAA, 0xCC, 0xCB, 0x12, 0xCC, 0xBB])
    with pytest.raises(TelegramFrameParserException,
                       match='Unresolvable Replacement Marker'):
        _TelegramFrameParser.extractContent(telegram)
def test_extractContentWithNoStart():
    telegram = bytes([0xCC, 0xCB, 0x12, 0xBB])
    with pytest.raises(TelegramFrameParserException, match='Unexpected Start'):
        _TelegramFrameParser.extractContent(telegram)
def test_extractContentWithNoEnd():
    telegram = bytes([0xAA, 0xCC, 0xCB, 0x12])
    with pytest.raises(TelegramFrameParserException, match='Unexpected End'):
        _TelegramFrameParser.extractContent(telegram)
def test_extractContent():
    telegram = bytes([0xAA, 0xCC, 0xCB, 0x12, 0xBB])
    content = _TelegramFrameParser.extractContent(telegram)
    assert content == bytes([0xCC, 0x12])