from juris_base.exceptions import JurisError, CaptchaError, SessionError, TooManyResults


def test_hierarchy():
    assert issubclass(CaptchaError, JurisError)
    assert issubclass(SessionError, JurisError)
    assert issubclass(TooManyResults, JurisError)


def test_too_many_results_carries_count():
    e = TooManyResults(total=5000, max_allowed=500)
    assert e.total == 5000
    assert e.max_allowed == 500
