interactive-coding-challenges/online_judges/math_ops/test_math_ops.py
2017-03-29 04:32:52 -04:00

33 lines
810 B
Python

from nose.tools import assert_equal, assert_true, assert_raises
class TestMathOps(object):
def test_math_ops(self):
solution = Solution()
assert_raises(TypeError, solution.insert, None)
solution.insert(5)
solution.insert(2)
solution.insert(7)
solution.insert(9)
solution.insert(9)
solution.insert(2)
solution.insert(9)
solution.insert(4)
solution.insert(3)
solution.insert(3)
solution.insert(2)
assert_equal(solution.max, 9)
assert_equal(solution.min, 2)
assert_equal(solution.mean, 5)
assert_true(solution.mode in (2, 92))
print('Success: test_math_ops')
def main():
test = TestMathOps()
test.test_math_ops()
if __name__ == '__main__':
main()