'''
Created on May 29, 2012

@author: liubida
'''

from freshman.classes import average
import unittest

class TestStatisticalFunctions(unittest.TestCase):

    def atest_average(self):
        self.assertEqual(average([20, 30, 70]), 40.0)
        self.assertEqual(round(average([1, 5, 7]), 1), 4.3)
        self.assertRaises(ZeroDivisionError, average, [])
        self.assertRaises(TypeError, average, 20, 30, 70)
        print "123"

suite = unittest.TestLoader().loadTestsFromTestCase(TestStatisticalFunctions)
unittest.TextTestRunner(verbosity=2).run(suite);

if __name__ == '__main__':
    pass
# Calling from the command line invokes all tests
#    unittest.main()