def test_delete_all_temperatures(self): assert len(self._get_all_temperatures()) == 0 temps = [hardware.temperature_probes.TemperatureReading("1", 27), hardware.temperature_probes.TemperatureReading("2", 53)] db_adapter.store_temperatures(temps) assert len(self._get_all_temperatures()) == 2 db_adapter.delete_all_temperatures() assert len(self._get_all_temperatures()) == 0
def test_store_temperatures(self): assert(len(self._get_all_temperatures()) == 0) temps = [hardware.temperature_probes.TemperatureReading("1", 27), hardware.temperature_probes.TemperatureReading("2", 53)] db_adapter.store_temperatures(temps) result = self._get_all_temperatures() assert(len(result) == 2) result1 = result[0] assert((result1[0] == '1') & (result1[1] == 27)) result2 = result[1] assert((result2[0] == '2') & (result2[1] == 53))