def test_server_down(self): with pytest.raises(ldap.SERVER_DOWN): session = pyldap_orm.LDAPSession(backend='ldap://localhost:1') session.authenticate()