Exemplo n.º 1
0
def test_regex_negative_wrong_status_code_callable():
    """Assert that expected exception with valid pattern but unexpected
    cli_return_code won't be handled and passed through to the test from
    `robottelo.cli.assertions.assert_cli_not_raises_regex` call.
    """
    with pytest.raises(CLIReturnCodeError):
        assert_cli_not_raises_regex(CLIReturnCodeError,
                                    pattern,
                                    fake_128_return_code,
                                    expected_value=129)
Exemplo n.º 2
0
def test_regex_positive_raised_callable_with_status_code():
    """Assert that the test will fail (not marked as errored) in case
    expected exception was risen inside
    `robottelo.cli.assertions.assert_cli_not_raises_regex` call and
    cli_return_code altogether with regex pattern match expected ones.
    """
    with pytest.raises(AssertionError):
        assert_cli_not_raises_regex(CLIReturnCodeError,
                                    pattern,
                                    fake_128_return_code,
                                    expected_value=128)
Exemplo n.º 3
0
def test_regex_positive_raised_callable_with_status_code():
    """Assert that the test will fail (not marked as errored) in case
    expected exception was risen inside
    `robottelo.cli.assertions.assert_cli_not_raises_regex` call and
    cli_return_code altogether with regex pattern match expected ones.
    """
    with pytest.raises(AssertionError):
        assert_cli_not_raises_regex(
            CLIReturnCodeError, pattern, fake_128_return_code,
            expected_value=128,
        )
Exemplo n.º 4
0
def test_regex_negative_wrong_status_code_callable():
    """Assert that expected exception with valid pattern but unexpected
    cli_return_code won't be handled and passed through to the test from
    `robottelo.cli.assertions.assert_cli_not_raises_regex` call.
    """
    with pytest.raises(CLIReturnCodeError):
        assert_cli_not_raises_regex(
            CLIReturnCodeError,
            pattern,
            fake_128_return_code,
            expected_value=129,
        )