mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-07 09:58:03 +00:00
Add prod three challenge
This commit is contained in:
21
online_judges/prod_three/test_prod_three.py
Normal file
21
online_judges/prod_three/test_prod_three.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from nose.tools import assert_equal, assert_raises
|
||||
|
||||
|
||||
class TestProdThree(object):
|
||||
|
||||
def test_prod_three(self):
|
||||
solution = Solution()
|
||||
assert_raises(TypeError, solution.max_prod_three, None)
|
||||
assert_raises(ValueError, solution.max_prod_three, [1, 2])
|
||||
assert_equal(solution.max_prod_three([5, -2, 3]), -30)
|
||||
assert_equal(solution.max_prod_three([5, -2, 3, 1, -1, 4]), 60)
|
||||
print('Success: test_prod_three')
|
||||
|
||||
|
||||
def main():
|
||||
test = TestProdThree()
|
||||
test.test_prod_three()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user