server/test/unittest_multisources.py
changeset 4766 162b2b127b15
parent 4691 ae468fae9965
child 5174 78438ad513ca
child 5421 8167de96c523
equal deleted inserted replaced
4764:ec9c20c6b9f7 4766:162b2b127b15
    46     Connection.close = lambda x: None
    46     Connection.close = lambda x: None
    47 
    47 
    48 def teardown_module(*args):
    48 def teardown_module(*args):
    49     PyroRQLSource.get_connection = PyroRQLSource_get_connection
    49     PyroRQLSource.get_connection = PyroRQLSource_get_connection
    50     Connection.close = Connection_close
    50     Connection.close = Connection_close
    51 
    51     global repo2, cnx2, repo3, cnx3
       
    52     repo2.shutdown()
       
    53     repo3.shutdown()
       
    54     del repo2, cnx2, repo3, cnx3
       
    55     #del TwoSourcesTC.config.vreg
       
    56     #del TwoSourcesTC.config
    52 
    57 
    53 class TwoSourcesTC(CubicWebTC):
    58 class TwoSourcesTC(CubicWebTC):
    54     config = TwoSourcesConfiguration('data')
    59     config = TwoSourcesConfiguration('data')
    55 
    60 
    56     @classmethod
    61     @classmethod
   128         self.commit()
   133         self.commit()
   129         cnx = self.login('anon')
   134         cnx = self.login('anon')
   130         cu = cnx.cursor()
   135         cu = cnx.cursor()
   131         rset = cu.execute('Any X WHERE X has_text "card"')
   136         rset = cu.execute('Any X WHERE X has_text "card"')
   132         self.assertEquals(len(rset), 5, zip(rset.rows, rset.description))
   137         self.assertEquals(len(rset), 5, zip(rset.rows, rset.description))
   133         cnx.close()
   138         Connection_close(cnx)
   134 
   139 
   135     def test_synchronization(self):
   140     def test_synchronization(self):
   136         cu = cnx2.cursor()
   141         cu = cnx2.cursor()
   137         assert cu.execute('Any X WHERE X eid %(x)s', {'x': self.aff1}, 'x')
   142         assert cu.execute('Any X WHERE X eid %(x)s', {'x': self.aff1}, 'x')
   138         cu.execute('SET X ref "BLAH" WHERE X eid %(x)s', {'x': self.aff1}, 'x')
   143         cu.execute('SET X ref "BLAH" WHERE X eid %(x)s', {'x': self.aff1}, 'x')