server/test/unittest_session.py
branchstable
changeset 5210 1c635a91e403
parent 5193 c9671feff5e2
child 5197 98dc05495e3e
equal deleted inserted replaced
5209:52c9d25101a1 5210:1c635a91e403
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     7 """
     7 """
     8 from logilab.common.testlib import TestCase, unittest_main, mock_object
     8 from logilab.common.testlib import TestCase, unittest_main, mock_object
     9 
     9 
       
    10 from cubicweb.devtools.testlib import CubicWebTC
    10 from cubicweb.server.session import _make_description
    11 from cubicweb.server.session import _make_description
    11 
    12 
    12 class Variable:
    13 class Variable:
    13     def __init__(self, name):
    14     def __init__(self, name):
    14         self.name = name
    15         self.name = name
    30     def test_known_values(self):
    31     def test_known_values(self):
    31         solution = {'A': 'Int', 'B': 'CWUser'}
    32         solution = {'A': 'Int', 'B': 'CWUser'}
    32         self.assertEquals(_make_description((Function('max', 'A'), Variable('B')), {}, solution),
    33         self.assertEquals(_make_description((Function('max', 'A'), Variable('B')), {}, solution),
    33                           ['Int','CWUser'])
    34                           ['Int','CWUser'])
    34 
    35 
       
    36 class InternalSessionTC(CubicWebTC):
       
    37     def test_dbapi_query(self):
       
    38         session = self.repo.internal_session()
       
    39         self.assertFalse(session.running_dbapi_query)
       
    40 
    35 if __name__ == '__main__':
    41 if __name__ == '__main__':
    36     unittest_main()
    42     unittest_main()