def setup_db(self): JCLRunner.setup_db(self) MailAccount.createTable(ifNotExists=True) IMAPAccount.createTable(ifNotExists=True) POP3Account.createTable(ifNotExists=True) AbstractSMTPAccount.createTable(ifNotExists=True) GlobalSMTPAccount.createTable(ifNotExists=True) SMTPAccount.createTable(ifNotExists=True)
def test__run(self): self.runner.pid_file = "/tmp/jmc.pid" self.runner.db_url = self.db_url def do_nothing(): return (False, 0) self.runner._run(do_nothing) model.db_connection_str = self.runner.db_url model.db_connect() # dropTable should succeed because tables should exist Account.dropTable() PresenceAccount.dropTable() User.dropTable() LegacyJID.dropTable() MailAccount.dropTable() IMAPAccount.dropTable() POP3Account.dropTable() SMTPAccount.dropTable() model.db_disconnect() self.assertFalse(os.access("/tmp/jmc.pid", os.F_OK))