mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
don't restart ldap in tests
This commit is contained in:
parent
7fed0e5051
commit
f2370c0444
1 changed files with 4 additions and 1 deletions
|
@ -66,11 +66,14 @@ class TestLDAP:
|
|||
|
||||
assert ldap_interface.con
|
||||
|
||||
def test_authenticate_server_down(self, ldap_server):
|
||||
def test_authenticate_server_down(self, ldap_server, mocker):
|
||||
self.ldap_conf["parameters"]["uri"] = ldap_server.uri
|
||||
self.ldap_conf["parameters"]["user_rdn"] = "cn=admin,dc=yunohost,dc=org"
|
||||
ldap_server.stop()
|
||||
ldap_interface = m_ldap.Authenticator(**self.ldap_conf)
|
||||
|
||||
# Now if slapd is down, moulinette tries to restart it
|
||||
mocker.patch("os.system")
|
||||
with pytest.raises(MoulinetteError) as exception:
|
||||
ldap_interface.authenticate(password="yunohost")
|
||||
|
||||
|
|
Loading…
Reference in a new issue