[test] fixes when executed under apycot environment (also added ldap1 to test host /etc/hosts)
--- a/server/test/unittest_hook.py Thu Mar 25 15:11:44 2010 +0100
+++ b/server/test/unittest_hook.py Fri Mar 26 06:57:52 2010 +0100
@@ -92,19 +92,19 @@
class _Hook(hook.Hook):
events = ('before_add_entiti',)
ex = self.assertRaises(Exception, self.o.register, _Hook)
- self.assertEquals(str(ex), 'bad event before_add_entiti on unittest_hook._Hook')
+ self.assertEquals(str(ex), 'bad event before_add_entiti on %s._Hook' % __name__)
def test_register_bad_hook2(self):
class _Hook(hook.Hook):
events = None
ex = self.assertRaises(Exception, self.o.register, _Hook)
- self.assertEquals(str(ex), 'bad .events attribute None on unittest_hook._Hook')
+ self.assertEquals(str(ex), 'bad .events attribute None on %s._Hook' % __name__)
def test_register_bad_hook3(self):
class _Hook(hook.Hook):
events = 'before_add_entity'
ex = self.assertRaises(Exception, self.o.register, _Hook)
- self.assertEquals(str(ex), 'bad event b on unittest_hook._Hook')
+ self.assertEquals(str(ex), 'bad event b on %s._Hook' % __name__)
def test_call_hook(self):
self.o.register(AddAnyHook)
--- a/server/test/unittest_ldapuser.py Thu Mar 25 15:11:44 2010 +0100
+++ b/server/test/unittest_ldapuser.py Fri Mar 26 06:57:52 2010 +0100
@@ -15,7 +15,7 @@
from cubicweb.server.sources.ldapuser import *
-if socket.gethostbyname('ldap1').startswith('172'):
+if '17.1' in socket.gethostbyname('ldap1'):
SYT = 'syt'
ADIM = 'adim'
else: