From ffd4798f233671ab2283f5cf7f96ceab570a96cc Mon Sep 17 00:00:00 2001 From: Ammar Najjar Date: Tue, 11 Apr 2017 13:44:04 +0200 Subject: [PATCH] Fix two sum unit_test challenge to match the solution notebook (#176) --- arrays_strings/two_sum/two_sum_challenge.ipynb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arrays_strings/two_sum/two_sum_challenge.ipynb b/arrays_strings/two_sum/two_sum_challenge.ipynb index b482418..239cedb 100644 --- a/arrays_strings/two_sum/two_sum_challenge.ipynb +++ b/arrays_strings/two_sum/two_sum_challenge.ipynb @@ -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",