def test_page_should_contain_match_custom_message(mocker: MockerFixture,
                                                  under_test: x3270):
    mocker.patch("Mainframe3270.py3270.Emulator.string_get",
                 return_value="abc")

    with pytest.raises(Exception, match="my error message"):
        under_test.page_should_contain_match("*def*",
                                             error_message="my error message")
def test_page_should_contain_match_fails(mocker: MockerFixture,
                                         under_test: x3270):
    mocker.patch("Mainframe3270.py3270.Emulator.string_get",
                 return_value="abc")

    with pytest.raises(
            Exception,
            match=re.escape('No matches found for "*e?g*" pattern')):
        under_test.page_should_contain_match("*e?g*")
def test_page_should_contain_match_ignore_case(mocker: MockerFixture,
                                               under_test: x3270):
    mocker.patch("Mainframe3270.py3270.Emulator.string_get",
                 return_value="ABC")

    under_test.page_should_contain_match("*a?c*", ignore_case=True)
def test_page_should_contain_match(mocker: MockerFixture, under_test: x3270):
    mocker.patch("Mainframe3270.py3270.Emulator.string_get",
                 return_value="abc")

    under_test.page_should_contain_match("*a?c*")