def test_bad_url():

    client = Client(
        get_var('url_with_bad_hostname'),
        timeout=5
    )

    with pytest.raises(BalancerManagerError):
        client.test()
def test_bad_balancer_manager():

    client = Client(
        get_var('url_for_non-balancer-manager'),
        timeout=5
    )

    with pytest.raises(BalancerManagerParseError) as excinfo:
        client.set_apache_version()
    assert 'could not parse text from the first "dt" element' in str(excinfo.value)