diff --git a/spotifyvis/tests.py b/spotifyvis/tests.py index 8a9a2d5..b88c1e2 100644 --- a/spotifyvis/tests.py +++ b/spotifyvis/tests.py @@ -17,6 +17,7 @@ class UpdateStdDevTest(TestCase): self.assertTrue(math.isclose(new_mean, 7.5, rel_tol=0.01)) self.assertTrue(math.isclose(new_std_dev, 3.5355, rel_tol=0.01)) + def test_three_data_points(self): """ tests if update_std_dev behaves correctly for three data points @@ -28,7 +29,8 @@ class UpdateStdDevTest(TestCase): self.assertTrue(math.isclose(new_mean, 10, rel_tol=0.01)) self.assertTrue(math.isclose(new_std_dev, 5, rel_tol=0.01)) - + + def test_four_data_points(self): """ tests if update_std_dev behaves correctly for four data points @@ -41,7 +43,6 @@ class UpdateStdDevTest(TestCase): self.assertTrue(math.isclose(new_std_dev, 6.455, rel_tol=0.01)) - def test_five_data_points(self): """ tests if update_std_dev behaves correctly for five data points @@ -51,4 +52,16 @@ class UpdateStdDevTest(TestCase): new_mean, new_std_dev = update_std_dev(cur_mean, cur_std_dev, 63, 5) self.assertTrue(math.isclose(new_mean, 22.6, rel_tol=0.01)) - self.assertTrue(math.isclose(new_std_dev, 23.2658, rel_tol=0.01)) \ No newline at end of file + self.assertTrue(math.isclose(new_std_dev, 23.2658, rel_tol=0.01)) + + + def test_sixteen_data_points(self): + """ + tests if update_std_dev behaves correctly for sixteen data points + """ + cur_mean = 0.4441 + cur_std_dev = 0.2855 + + new_mean, new_std_dev = update_std_dev(cur_mean, cur_std_dev, 0.7361, 16) + self.assertTrue(math.isclose(new_mean, 0.4624, rel_tol=0.01)) + self.assertTrue(math.isclose(new_std_dev, 0.2853, rel_tol=0.01)) \ No newline at end of file