mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-06 09:28:02 +00:00
Add sum two challenge
This commit is contained in:
21
online_judges/sum_two/test_sum_two.py
Normal file
21
online_judges/sum_two/test_sum_two.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from nose.tools import assert_equal, assert_raises
|
||||
|
||||
|
||||
class TestSumTwo(object):
|
||||
|
||||
def test_sum_two(self):
|
||||
solution = Solution()
|
||||
assert_raises(TypeError, solution.sum_two, None)
|
||||
assert_equal(solution.sum_two(5, 7), 12)
|
||||
assert_equal(solution.sum_two(-5, -7), -12)
|
||||
assert_equal(solution.sum_two(5, -7), -2)
|
||||
print('Success: test_sum_two')
|
||||
|
||||
|
||||
def main():
|
||||
test = TestSumTwo()
|
||||
test.test_sum_two()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user