Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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()))
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)