Exemple #1
0
def test_raise_common_default():
    with pytest.raises(BatfishAssertException) as e:
        _raise_common("foobar")
    assert "foobar" in str(e.value)

    with pytest.raises(BatfishAssertException) as e:
        _raise_common("foobaragain", False)
    assert "foobaragain" in str(e.value)
Exemple #2
0
def test_raise_common_warn():
    with pytest.warns(BatfishAssertWarning):
        _raise_common("foobar", True)
Exemple #3
0
def test_raise_common_warn():
    with pytest.warns(BatfishAssertWarning):
        result = _raise_common("foobar", True)
    assert not result