def check_for_consistency_test(self):
        # read the number of rows from the database
        cur = self._db.cursor().execute("""SELECT COUNT(*) from TestTable""")
        nbrOfTuples = cur.fetchall()[0][0]

        # SQL extraction statement
        sqlstmt = """SELECT timestamp, value FROM TestTable ORDER BY timestamp ASC"""

        # Initialize one TimeSeries instance manually
        tsManual = TimeSeries()
        data     = self._db.cursor().execute(sqlstmt).fetchall()
        for entry in data:
            tsManual.add_entry(str(entry[0]), entry[1])

        # Initialize one TimeSeries from SQL cursor
        tsAuto = TimeSeries()
        tsAuto.initialize_from_sql_cursor(self._db.cursor().execute(sqlstmt))

        # check if those TimeSeries are equal
        assert (nbrOfTuples == len(tsManual))
        assert (nbrOfTuples == len(tsAuto))
        assert (len(tsManual) == len(tsAuto))
        assert (tsManual == tsAuto)
Tests if database initialization and manual initialization create equal TimeSeries instances.
dataset/ETHPy150Open T-002/pycast/pycast/tests/timeseriesdatabasetest.py/DatabaseConnectorTest.check_for_consistency_test