[ldap test] fix bad merge cubicweb-version-3.16.0
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 25 Jan 2013 16:44:07 +0100
changeset 8684 6c7c2a02c9a0
parent 8683 d537786e52b8
child 8686 853237d1daf6
[ldap test] fix bad merge
server/test/unittest_ldapuser.py
--- a/server/test/unittest_ldapuser.py	Fri Jan 25 14:33:40 2013 +0100
+++ b/server/test/unittest_ldapuser.py	Fri Jan 25 16:44:07 2013 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -51,7 +51,7 @@
     ldiffile = join(config.apphome, "ldap_test.ldif")
     config.info('Initing ldap database')
     cmdline = "/usr/sbin/slapadd -f %s -l %s -c" % (slapdconf, ldiffile)
-    subprocess.check_call(cmdline, shell=True) == 0
+    subprocess.call(cmdline, shell=True)
 
     #ldapuri = 'ldapi://' + join(basedir, "ldapi").replace('/', '%2f')
     port = get_available_port(xrange(9000, 9100))
@@ -115,14 +115,6 @@
             stats = source.repo_source.pull_data(session, force=True, raise_on_error=True)
             session.commit()
 
-    def setUp(self):
-        super(LDAPTestBase, self).setUp()
-        # ldap source url in the database may use a different port as the one
-        # just attributed
-        lfsource = self.repo.sources_by_uri['ldapuser']
-        lfsource.urls = [URL]
-
-
 class DeleteStuffFromLDAPFeedSourceTC(LDAPTestBase):
     test_db_id = 'ldap-feed'
 
@@ -200,7 +192,6 @@
         self.commit()
         self.assertRaises(AuthenticationError, self.repo.connect, 'syt', password='syt')
 
-
 class LDAPFeedSourceTC(LDAPTestBase):
     test_db_id = 'ldap-feed'
 
@@ -213,6 +204,13 @@
         lfsource = isession.repo.sources_by_uri['ldapuser']
         stats = lfsource.pull_data(isession, force=True, raise_on_error=True)
 
+    def setUp(self):
+        super(LDAPFeedSourceTC, self).setUp()
+        # ldap source url in the database may use a different port as the one
+        # just attributed
+        lfsource = self.repo.sources_by_uri['ldapuser']
+        lfsource.urls = [URL]
+
     def assertMetadata(self, entity):
         self.assertTrue(entity.creation_date)
         self.assertTrue(entity.modification_date)