utilities for testing output composition todo autoremove ansi colors to allow for testing of colorized output as well expecttokenstokenstokens soutput def assertoutputdoesnotmatchoutput str tokens iterableexpect r assertoutputdoesnotmatch rn expect body check the command output for an exact full sequence of tokens out get http 1 1 r naaa bbb r n r nccc n n assert_output_matches out expect request_headers expect body expect separator todo auto remove ansi colors to allow for testing of colorized output as well assert_output_does_not_match r n expect body
from typing import Iterable

import pytest

from .parsing import OutputMatchingError, expect_tokens
from .tokens import Expect, ExpectSequence


__all__ = [
    'assert_output_matches',
    'assert_output_does_not_match',
    'Expect',
    'ExpectSequence',
]


def assert_output_matches(output: str, tokens: Iterable[Expect]):
    r
    
    expect_tokens(tokens=tokens, s=output)


def assert_output_does_not_match(output: str, tokens: Iterable[Expect]):
    r
    with pytest.raises(OutputMatchingError):
        assert_output_matches(output=output, tokens=tokens)