def setup_db(self): self.db_file = T.testdb.make_test_db() MockedSettings['db_uri'] = T.testdb.get_temp_db_uri(self.db_file) MockedSettings['irc'] = { "nickname": "pushhamster+test", "channel": "pushmanagertest" } with mock.patch.dict(db.Settings, MockedSettings): db.init_db()
def setup_db(self): self.db_file_path = testdb.create_temp_db_file() MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file_path) with patch.dict(db.Settings, MockedSettings): db.init_db() self.insert_checklists() yield db.finalize_db() os.unlink(self.db_file_path)
def setup_db(self): self.temp_git_dirs = [] self.db_file = testdb.make_test_db() MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file) MockedSettings['irc'] = { "nickname": "pushhamster+test", "channel": "pushmanagertest" } with mock.patch.dict(db.Settings, MockedSettings): db.init_db()
def main(): usage = 'usage: %prog <oldtype> <newtype>' parser = OptionParser(usage) (_, args) = parser.parse_args() if len(args) == 2: db.init_db() convert_tag(args[0], args[1]) db.finalize_db() else: parser.error('Incorrect number of arguments')
def main(): usage = 'usage: %prog <oldtag> <newtag>' parser = OptionParser(usage) (_, args) = parser.parse_args() if len(args) == 2: db.init_db() convert_checklist(args[0], args[1]) db.finalize_db() else: parser.error('Incorrect number of arguments')
def setup_db(self): self.setup_async_test_case() self.db_file = testdb.make_test_db() MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file) MockedSettings['irc'] = { "nickname": "pushhamster+test", "channel": "pushmanagertest" } # for the purpose of unittests we'll use a single application # for API and main site. MockedSettings['api_app'] = { "domain": "localhost", "port": self.get_http_port() } with mock.patch.dict(db.Settings, MockedSettings): db.init_db()
def main(): app = PushManagerApp() db.init_db() app.run()
def setup_db_settings(self): self.db_file_path = testdb.create_temp_db_file() MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file_path) with mock.patch.dict(db.Settings, MockedSettings): db.init_db() self.populate_database()