def test_get_mean_singel_value(self): tr = TempTracker() tr.insert(50) self.assertEqual(tr.get_mean(), 50.0)
def test_get_mean_mulit_value(self): tr = TempTracker() for x in [0, 5, 10, 5]: tr.insert(x) self.assertEqual(tr.get_mean(), 5.0)
def test_mode_one_multiple_value(self): tr = TempTracker() for x in [0, 1, 2, 3, 4, 5, 4]: tr.insert(x) self.assertEqual(tr.get_mode(), 4)
def test_mode_multiple_modes(self): tr = TempTracker() for x in [5, 0, 1, 2, 3, 4, 5, 4]: tr.insert(x) self.assertTrue(tr.get_mode() in [4, 5])
def test_mode_one_single_value(self): tr = TempTracker() tr.insert(2) self.assertEqual(tr.get_mode(), 2)
def test_min(self): tr = TempTracker() for x in [1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 0, 5, 6]: tr.insert(x) self.assertEqual(tr.get_min(), 0)
def test_max(self): tr = TempTracker() for x in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6]: tr.insert(x) self.assertEqual(tr.get_max(), 9)
def test_multiple_inserts(self): y = 10 tr = TempTracker() for x in range(0, y): tr.insert(x) self.assertEqual(len(tr._get_temps()), 10)
def test_insert(self): tr = TempTracker() tr.insert(25) self.assertEqual(tr._get_temps(), [25,])