def configure(self, cfg): """ Configuration and initialization is delayed to allow working with CherryPy configuration API """ self.config = cfg create_tables(get_db_connection(self.config)) self.worker_set = WorkerSet(cfg) for w in Watch.load_all(get_db_connection(self.config)): self.worker_set.add(w.id)
def setUp(self): self.connection = create_db_connection({'sqlite.file':':memory:'}) create_tables(self.connection)