interactive-coding-challenges/math_probability/sub_two/test_sub_two.py

23 lines
531 B
Python
Raw Normal View History

import unittest
2017-03-29 16:41:24 +08:00
class TestSubTwo(unittest.TestCase):
2017-03-29 16:41:24 +08:00
def test_sub_two(self):
solution = Solution()
self.assertRaises(TypeError, solution.sub_two, None)
self.assertEqual(solution.sub_two(7, 5), 2)
self.assertEqual(solution.sub_two(-5, -7), 2)
self.assertEqual(solution.sub_two(-5, 7), -12)
self.assertEqual(solution.sub_two(5, -7), 12)
2017-03-29 16:41:24 +08:00
print('Success: test_sub_two')
def main():
test = TestSubTwo()
test.test_sub_two()
if __name__ == '__main__':
main()