mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 17:34:21 +01:00
adding unit test for del user if user don't exist
This commit is contained in:
parent
8387aa0cad
commit
0f97d1d07c
@ -7,7 +7,7 @@ from __future__ import unicode_literals
|
|||||||
import pytest
|
import pytest
|
||||||
import sys
|
import sys
|
||||||
from sets import Set
|
from sets import Set
|
||||||
from ldapcherry.backend.backendLdap import Backend
|
from ldapcherry.backend.backendLdap import Backend, DelUserDontExists
|
||||||
from ldapcherry.exceptions import *
|
from ldapcherry.exceptions import *
|
||||||
import cherrypy
|
import cherrypy
|
||||||
import logging
|
import logging
|
||||||
@ -168,6 +168,17 @@ class TestError(object):
|
|||||||
inv.del_user('test')
|
inv.del_user('test')
|
||||||
raise AssertionError("expected an exception")
|
raise AssertionError("expected an exception")
|
||||||
|
|
||||||
|
def testDelUserDontExists(self):
|
||||||
|
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
|
||||||
|
try:
|
||||||
|
inv.del_user('test')
|
||||||
|
inv.del_user('test')
|
||||||
|
except DelUserDontExists:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
raise AssertionError("expected an exception")
|
||||||
|
|
||||||
|
|
||||||
def testAddUserMissingMustAttribute(self):
|
def testAddUserMissingMustAttribute(self):
|
||||||
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
|
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
|
||||||
user = {
|
user = {
|
||||||
|
Loading…
Reference in New Issue
Block a user