devtools/fake.py
changeset 7398 26695dd703d8
parent 7360 dbff01dd3c3c
child 7436 28ec860c4436
equal deleted inserted replaced
7397:6a9e66d788b3 7398:26695dd703d8
   144         if vreg is None:
   144         if vreg is None:
   145             vreg = getattr(self.repo, 'vreg', None)
   145             vreg = getattr(self.repo, 'vreg', None)
   146         if vreg is None:
   146         if vreg is None:
   147             vreg = CubicWebVRegistry(FakeConfig(), initlog=False)
   147             vreg = CubicWebVRegistry(FakeConfig(), initlog=False)
   148         self.vreg = vreg
   148         self.vreg = vreg
   149         self.pool = FakePool()
   149         self.cnxset = FakeConnectionsSet()
   150         self.user = user or FakeUser()
   150         self.user = user or FakeUser()
   151         self.is_internal_session = False
   151         self.is_internal_session = False
   152         self.transaction_data = {}
   152         self.transaction_data = {}
   153 
   153 
   154     def execute(self, *args, **kwargs):
   154     def execute(self, *args, **kwargs):
   208     dbhelper = get_db_helper('sqlite')
   208     dbhelper = get_db_helper('sqlite')
   209     def __init__(self, uri):
   209     def __init__(self, uri):
   210         self.uri = uri
   210         self.uri = uri
   211 
   211 
   212 
   212 
   213 class FakePool(object):
   213 class FakeConnectionsSet(object):
   214     def source(self, uri):
   214     def source(self, uri):
   215         return FakeSource(uri)
   215         return FakeSource(uri)