Commit 3b051d79 authored by Lorenz Steinert's avatar Lorenz Steinert

fixed tests

parent 2558c661
...@@ -72,7 +72,7 @@ class FsrLdapTest(unittest.TestCase): ...@@ -72,7 +72,7 @@ class FsrLdapTest(unittest.TestCase):
"""test the get_fsr_extern_ldap function""" """test the get_fsr_extern_ldap function"""
self.assertEqual(self.ldap_server._get_fsr_extern_ldap(), self.assertEqual(self.ldap_server._get_fsr_extern_ldap(),
['testing test2']) ['testing test2'])
self.assertEqual(self.info, ['Fetching EFSR from LDAP ...', 'Done']) self.assertEqual(self.info, ['Fetching eFSR from LDAP ...', 'Done'])
self.assertEqual(self.warning, []) self.assertEqual(self.warning, [])
def test_get_protokollant_ldap(self): def test_get_protokollant_ldap(self):
...@@ -139,7 +139,7 @@ class FsrLdapTest(unittest.TestCase): ...@@ -139,7 +139,7 @@ class FsrLdapTest(unittest.TestCase):
self.ldap_server.conn.search = self.ldap_search_fail self.ldap_server.conn.search = self.ldap_search_fail
self.assertEqual(self.ldap_server._get_fsr_extern_ldap(), self.assertEqual(self.ldap_server._get_fsr_extern_ldap(),
esme.Error.UNSEC_SEARCH) esme.Error.UNSEC_SEARCH)
self.assertEqual(self.info, ['Fetching EFSR from LDAP ...']) self.assertEqual(self.info, ['Fetching eFSR from LDAP ...'])
self.assertEqual(self.warning, []) self.assertEqual(self.warning, [])
def test_get_protokollant_ldap_no_server(self): def test_get_protokollant_ldap_no_server(self):
...@@ -158,16 +158,16 @@ class FsrLdapTest(unittest.TestCase): ...@@ -158,16 +158,16 @@ class FsrLdapTest(unittest.TestCase):
esme.Error.LDAP_FAIL) esme.Error.LDAP_FAIL)
self.assertEqual(self.info, ['Fetching FSR from LDAP ...']) self.assertEqual(self.info, ['Fetching FSR from LDAP ...'])
self.assertEqual(self.warning, self.assertEqual(self.warning,
["Couldn't Connect to ldap. Using fallback File."]) ["Couldn't Connect to the LDAP-Server. Using fall-back file."])
def test_get_fsr_extern_ldap_ldap_exception(self): def test_get_fsr_extern_ldap_ldap_exception(self):
"""test the get_fsr_extern_ldap function with a LDAPException""" """test the get_fsr_extern_ldap function with a LDAPException"""
self.ldap_server.conn.search = self.ldap_exception self.ldap_server.conn.search = self.ldap_exception
self.assertEqual(self.ldap_server._get_fsr_extern_ldap()[0], self.assertEqual(self.ldap_server._get_fsr_extern_ldap()[0],
esme.Error.LDAP_FAIL) esme.Error.LDAP_FAIL)
self.assertEqual(self.info, ['Fetching EFSR from LDAP ...']) self.assertEqual(self.info, ['Fetching eFSR from LDAP ...'])
self.assertEqual(self.warning, self.assertEqual(self.warning,
["Couldn't Connect to ldap. Using fallback File."]) ["Couldn't connect to the LDAP-Server. Using fall-back file."])
def test_get_protokollant_ldap_ldap_exception(self): def test_get_protokollant_ldap_ldap_exception(self):
"""test the get_protokollant_ldap function with a LDAPException""" """test the get_protokollant_ldap function with a LDAPException"""
...@@ -177,7 +177,7 @@ class FsrLdapTest(unittest.TestCase): ...@@ -177,7 +177,7 @@ class FsrLdapTest(unittest.TestCase):
esme.Error.LDAP_FAIL) esme.Error.LDAP_FAIL)
self.assertEqual(self.info, ['Fetching Protokollant from LDAP ...']) self.assertEqual(self.info, ['Fetching Protokollant from LDAP ...'])
self.assertEqual(self.warning, self.assertEqual(self.warning,
["Couldn't Connect to ldap. Using fallback default."]) ["Couldn't Connect to the LDAP-Server. Using fall-back default."])
def tearDown(self): def tearDown(self):
"""cleanup after the tests""" """cleanup after the tests"""
...@@ -270,7 +270,7 @@ class GetFuncTest(unittest.TestCase): ...@@ -270,7 +270,7 @@ class GetFuncTest(unittest.TestCase):
self.assertEqual(self.info, []) self.assertEqual(self.info, [])
self.assertEqual(self.warning, self.assertEqual(self.warning,
['No non default ini file found using default file.', ['No non default ini file found using default file.',
'No ini file found. Using hardcoded defaults.']) 'No ini file found. Using hard codded defaults.'])
def test_get_share(self): def test_get_share(self):
"""test the get_share function""" """test the get_share function"""
...@@ -315,7 +315,7 @@ class GetFuncTest(unittest.TestCase): ...@@ -315,7 +315,7 @@ class GetFuncTest(unittest.TestCase):
self.assertEqual(self.info, []) self.assertEqual(self.info, [])
self.assertEqual(self.warning, self.assertEqual(self.warning,
['No LDAP Server supplied. ' ['No LDAP Server supplied. '
+ 'Triing to use "rincwind.fs.physik.uni-kl.de".']) + 'Trying to use "rincewind.fs.physik.uni-kl.de".'])
def test_get_ldap_base(self): def test_get_ldap_base(self):
"""test the get_ldap_base function""" """test the get_ldap_base function"""
...@@ -329,7 +329,7 @@ class GetFuncTest(unittest.TestCase): ...@@ -329,7 +329,7 @@ class GetFuncTest(unittest.TestCase):
self.assertEqual(self.info, []) self.assertEqual(self.info, [])
self.assertEqual(self.warning, self.assertEqual(self.warning,
['No LDAP search base supplied. ' ['No LDAP search base supplied. '
+ 'Triing to use "dc=fs,dc=physik,dc=uni-kl,dc=de".']) + 'Trying to use "dc=fs,dc=physik,dc=uni-kl,dc=de".'])
def test_get_server_timeout(self): def test_get_server_timeout(self):
"""test the get_server_timeout function""" """test the get_server_timeout function"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment