Esempio n. 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)
Esempio n. 2
0
def test_raise_common_warn():
    with pytest.warns(BatfishAssertWarning):
        _raise_common("foobar", True)
Esempio n. 3
0
def test_raise_common_warn():
    with pytest.warns(BatfishAssertWarning):
        result = _raise_common("foobar", True)
    assert not result