equal
deleted
inserted
replaced
413 |
413 |
414 @property |
414 @property |
415 def dbname(self): |
415 def dbname(self): |
416 return self.system_source['db-name'] |
416 return self.system_source['db-name'] |
417 |
417 |
418 def init_test_database(): |
418 def init_test_database(self): |
419 """actual initialisation of the database""" |
419 """actual initialisation of the database""" |
420 raise ValueError('no initialization function for driver %r' % driver) |
420 raise ValueError('no initialization function for driver %r' % self.DRIVER) |
421 |
421 |
422 def has_cache(self, db_id): |
422 def has_cache(self, db_id): |
423 """Check if a given database id exist in cb cache for the current config""" |
423 """Check if a given database id exist in cb cache for the current config""" |
424 cache_glob = self.absolute_backup_file('*', '*') |
424 cache_glob = self.absolute_backup_file('*', '*') |
425 if cache_glob not in self.explored_glob: |
425 if cache_glob not in self.explored_glob: |
634 |
634 |
635 def init_test_database(self): |
635 def init_test_database(self): |
636 """initialize a fresh sqlserver databse used for testing purpose""" |
636 """initialize a fresh sqlserver databse used for testing purpose""" |
637 if self.config.init_repository: |
637 if self.config.init_repository: |
638 from cubicweb.server import init_repository |
638 from cubicweb.server import init_repository |
639 init_repository(config, interactive=False, drop=True) |
639 init_repository(self.config, interactive=False, drop=True) |
640 |
640 |
641 ### sqlite test database handling ############################################## |
641 ### sqlite test database handling ############################################## |
642 |
642 |
643 class SQLiteTestDataBaseHandler(TestDataBaseHandler): |
643 class SQLiteTestDataBaseHandler(TestDataBaseHandler): |
644 DRIVER = 'sqlite' |
644 DRIVER = 'sqlite' |