cubicweb/server/test/unittest_ssplanner.py
changeset 11767 432f87a63057
parent 11269 73ac69970047
child 11768 b8b71dd09a2c
equal deleted inserted replaced
11766:d8de1ac21f36 11767:432f87a63057
     1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    18 
    18 
    19 from cubicweb.devtools import TestServerConfiguration, get_test_db_handler
    19 from cubicweb.devtools import TestServerConfiguration, get_test_db_handler
    20 from cubicweb.devtools.repotest import BasePlannerTC, check_plan
    20 from cubicweb.devtools.repotest import BasePlannerTC, check_plan
    21 from cubicweb.server.ssplanner import SSPlanner
    21 from cubicweb.server.ssplanner import SSPlanner
    22 
    22 
    23 # keep cnx so it's not garbage collected and the associated session closed
    23 
    24 def setUpModule(*args):
    24 def setUpModule(*args):
       
    25     # keep cnx so it's not garbage collected and the associated session closed
    25     global repo, cnx
    26     global repo, cnx
    26     handler = get_test_db_handler(TestServerConfiguration('data', __file__))
    27     handler = get_test_db_handler(TestServerConfiguration('data', __file__))
    27     handler.build_db_cache()
    28     handler.build_db_cache()
    28     global repo, cnx
    29     global repo, cnx
    29     repo, cnx = handler.get_repo_and_cnx()
    30     repo, cnx = handler.get_repo_and_cnx()
    30 
    31 
       
    32 
    31 def tearDownModule(*args):
    33 def tearDownModule(*args):
    32     global repo, cnx
    34     global repo, cnx
    33     del repo, cnx
    35     del repo, cnx
       
    36 
    34 
    37 
    35 class SSPlannerTC(BasePlannerTC):
    38 class SSPlannerTC(BasePlannerTC):
    36     _test = check_plan
    39     _test = check_plan
    37 
    40 
    38     def setUp(self):
    41     def setUp(self):