def checkDBHistoryInsertion(conn, cursor): seriesID = 1 date=0 value=201 lib_DBInstructions.insertDataPoint_DataHistoryTable(conn, cursor, seriesID, date, value) lib_DBInstructions.insertDataPoint_DataHistoryTable(conn, cursor, seriesID, date+1, value+1) assert [(date, value),(date+1, value+1)] == lib_DBInstructions.getCompleteDataHistory_DataHistoryTable(conn, cursor, seriesID)
def __save_value_db(self, date, value, isInterpolated=False, isForecast=False): ''' CONSIDER: Is it appropriate to cast values here? I think so.... ''' return lib_DBInst.insertDataPoint_DataHistoryTable( self._hndl_DB.conn, self._hndl_DB.cursor, self.seriesID, int(date), float(value), interpolated=int(isInterpolated), forecast=int(isForecast))