def test_save_monthly(self): pygazparOptions = PyGazparOptions() pygazparOptions.testMode = True entityRecorder = EntityRecorder("unit test context", pygazparOptions, TestEntityRecorder.CONNECTION_STRING) entity = entityRecorder.load(Frequency.MONTHLY, 0) entityRecorder.save(entity)
def test_load_monthly(self): pygazparOptions = PyGazparOptions() pygazparOptions.testMode = True entityRecorder = EntityRecorder("unit test context", pygazparOptions, TestEntityRecorder.CONNECTION_STRING) entity = entityRecorder.load(Frequency.MONTHLY, 0) assert(24 == len(entity.history()))
def test_load_hourly(self): pygazparOptions = PyGazparOptions() pygazparOptions.testMode = True entityRecorder = EntityRecorder("unit test context", pygazparOptions, TestEntityRecorder.CONNECTION_STRING) entity = entityRecorder.load(Frequency.HOURLY, 0) assert(entity is None)
def test_save_statistics(self): pygazparOptions = PyGazparOptions() # pygazparOptions.testMode = True pygazparOptions.username = "******" pygazparOptions.password = "******" entityRecorder = EntityRecorder("unit test context", pygazparOptions, TestEntityRecorder.CONNECTION_STRING) entity = entityRecorder.load(Frequency.DAILY, 0, 1095) entityRecorder.saveAsStatistics(entity)