server/test/unittest_checkintegrity.py
changeset 4766 162b2b127b15
parent 4675 9233a8350420
child 5421 8167de96c523
equal deleted inserted replaced
4764:ec9c20c6b9f7 4766:162b2b127b15
    11 from cubicweb.devtools import init_test_database
    11 from cubicweb.devtools import init_test_database
    12 
    12 
    13 
    13 
    14 from cubicweb.server.checkintegrity import check
    14 from cubicweb.server.checkintegrity import check
    15 
    15 
    16 repo, cnx = init_test_database()
       
    17 
       
    18 class CheckIntegrityTC(TestCase):
    16 class CheckIntegrityTC(TestCase):
    19     def test(self):
    17     def test(self):
       
    18         repo, cnx = init_test_database()
    20         sys.stderr = sys.stdout = StringIO()
    19         sys.stderr = sys.stdout = StringIO()
    21         try:
    20         try:
    22             check(repo, cnx, ('entities', 'relations', 'text_index', 'metadata'),
    21             check(repo, cnx, ('entities', 'relations', 'text_index', 'metadata'),
    23                   reindex=True, fix=True, withpb=False)
    22                   reindex=True, fix=True, withpb=False)
    24         finally:
    23         finally:
    25             sys.stderr = sys.__stderr__
    24             sys.stderr = sys.__stderr__
    26             sys.stdout = sys.__stdout__
    25             sys.stdout = sys.__stdout__
       
    26         repo.shutdown()
    27 
    27 
    28 if __name__ == '__main__':
    28 if __name__ == '__main__':
    29     unittest_main()
    29     unittest_main()