Fix two sum unit_test challenge to match the solution notebook (#176)

This commit is contained in:
Ammar Najjar 2017-04-11 13:44:04 +02:00 committed by Donne Martin
parent d60f4a904c
commit ffd4798f23

View File

@ -122,8 +122,12 @@
"\n",
" def test_two_sum(self):\n",
" solution = Solution()\n",
" assert_raises(TypeError, solution.two_sum, None)\n",
" assert_equal(solution.two_sum(0), 0)\n",
" assert_raises(TypeError, solution.two_sum, None, None)\n",
" assert_raises(ValueError, solution.two_sum, [], 0)\n",
" target = 7\n",
" nums = [1, 3, 2, -7, 5]\n",
" expected = [2, 4]\n",
" assert_equal(solution.two_sum(nums, target), expected)\n",
" print('Success: test_two_sum')\n",
"\n",
"\n",