2020-07-15 09:23:57 +08:00
|
|
|
import unittest
|
2017-03-29 16:41:24 +08:00
|
|
|
|
|
|
|
|
2020-07-15 09:23:57 +08:00
|
|
|
class TestSubTwo(unittest.TestCase):
|
2017-03-29 16:41:24 +08:00
|
|
|
|
|
|
|
def test_sub_two(self):
|
|
|
|
solution = Solution()
|
2020-07-15 09:23:57 +08:00
|
|
|
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__':
|
2020-07-15 09:23:57 +08:00
|
|
|
main()
|