[devtools] Rename FakeSession into FakeConnection
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Mar 2017 17:03:28 +0100
changeset 12035 2fcb9339f69a
parent 12034 e7e469d0539b
child 12036 4c2c731f9190
[devtools] Rename FakeSession into FakeConnection because it is what it is.
cubicweb/devtools/fake.py
cubicweb/devtools/repotest.py
cubicweb/server/test/unittest_hook.py
--- a/cubicweb/devtools/fake.py	Fri Mar 10 16:55:57 2017 +0100
+++ b/cubicweb/devtools/fake.py	Fri Mar 10 17:03:28 2017 +0100
@@ -132,7 +132,7 @@
         return True
 
 
-class FakeSession(RequestSessionBase):
+class FakeConnection(RequestSessionBase):
 
     def __init__(self, repo=None, user=None, vreg=None):
         self.repo = repo
--- a/cubicweb/devtools/repotest.py	Fri Mar 10 16:55:57 2017 +0100
+++ b/cubicweb/devtools/repotest.py	Fri Mar 10 17:03:28 2017 +0100
@@ -135,7 +135,7 @@
 from rql import RQLHelper
 
 from cubicweb.devtools.testlib import BaseTestCase
-from cubicweb.devtools.fake import FakeRepo, FakeConfig, FakeSession, FakeRequest
+from cubicweb.devtools.fake import FakeRepo, FakeConfig, FakeRequest, FakeConnection
 from cubicweb.server import set_debug, debugged
 from cubicweb.server.querier import QuerierHelper
 from cubicweb.server.session import Session
@@ -182,7 +182,7 @@
         #print '********* solutions', solutions
         self.rqlhelper.simplify(union)
         #print '********* simplified', union.as_string()
-        plan = self.qhelper.plan_factory(union, {}, FakeSession(self.repo))
+        plan = self.qhelper.plan_factory(union, {}, FakeConnection(self.repo))
         plan.preprocess(union)
         for select in union.children:
             select.solutions.sort(key=lambda x: list(x.items()))
--- a/cubicweb/server/test/unittest_hook.py	Fri Mar 10 16:55:57 2017 +0100
+++ b/cubicweb/server/test/unittest_hook.py	Fri Mar 10 17:03:28 2017 +0100
@@ -112,7 +112,7 @@
     def test_call_hook(self):
         self.o.register(AddAnyHook)
         dis = set()
-        cw = fake.FakeSession()
+        cw = fake.FakeConnection()
         cw.is_hook_activated = lambda cls: cls.category not in dis
         self.assertRaises(HookCalled,
                           self.o.call_hooks, 'before_add_entity', cw)