def clearTables(): ''' Drops all SQL tables in database (scriptLog, script, computer and user) @param None. @return None. @Notes All rows of a given table are deleted upon a drop table operation. If any of these deletions trigger errors due to foreign key constraints or other issues, an error will be raised. No error will be raised for dropping empty tables regardless of foreign key constraints on them. ''' e = tosl.ScriptLogTable().deleteTable() e = tos.ScriptTable().deleteTable() e = toc.ComputerTable().deleteTable() e = tou.UserTable().deleteTable()
def test_deleteTableEmptyU(self): createEmptyTables() err = tou.UserTable().deleteTable() errExp = pref.getError(pref.ERROR_SUCCESS) self.assertEqual(err, errExp)
def test_createTableU(self): clearTables() err = tou.UserTable().createTable() errExp = pref.getError(pref.ERROR_SUCCESS) self.assertEqual(err, errExp)