| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python3 |
||
| 2 | 1 | """ |
|
| 3 | test exercise 01 functions |
||
| 4 | """ |
||
| 5 | |||
| 6 | 1 | import unittest |
|
| 7 | 1 | import exercises01 as matmod |
|
| 8 | |||
| 9 | 1 | class Testcase(unittest.TestCase): |
|
| 10 | """ |
||
| 11 | Test class using python unittest |
||
| 12 | """ |
||
| 13 | 1 | def test_mean(self): |
|
| 14 | """ test mean function """ |
||
| 15 | 1 | self.assertEqual(matmod.mean([1, 1, 1, 1, 3, 4, 5]), 2.29) |
|
| 16 | |||
| 17 | |||
| 18 | 1 | def test_variance(self): |
|
| 19 | """ test variance function """ |
||
| 20 | 1 | self.assertEqual(matmod.variance([1, 1, 1, 1, 3, 4, 5, 1, 1, 10, 11]), 13.87) |
|
| 21 | |||
| 22 | 1 | def test_stddev(self): |
|
| 23 | """ test standard deviation """ |
||
| 24 | 1 | self.assertEqual(matmod.stddev([1, 2, -2, 4, -3]), 2.88) |
|
| 25 | |||
| 26 | 1 | if __name__ == '__main__': |
|
| 27 | unittest.main() |
||
| 28 |