mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-08 18:38:03 +00:00
@@ -1,14 +1,14 @@
|
||||
from nose.tools import assert_equal, assert_raises
|
||||
import unittest
|
||||
|
||||
|
||||
class TestProdThree(object):
|
||||
class TestProdThree(unittest.TestCase):
|
||||
|
||||
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)
|
||||
self.assertRaises(TypeError, solution.max_prod_three, None)
|
||||
self.assertRaises(ValueError, solution.max_prod_three, [1, 2])
|
||||
self.assertEqual(solution.max_prod_three([5, -2, 3]), -30)
|
||||
self.assertEqual(solution.max_prod_three([5, -2, 3, 1, -1, 4]), 60)
|
||||
print('Success: test_prod_three')
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user