     },
     "outputs": [],
     "source": [
      "# %load test_n_pairs_parentheses.py\n",
      "from nose.tools import assert_equal\n",
      "\n",
      "\n",
      "class TestPairParentheses(object):\n",
      "\n",
      "    def test_pair_parentheses(self, solution):\n",
 
</s> remove     "from nose.tools import assert_equal\n",
 </s> add     "from nose.tools import assert_equal, assert_raises\n", </s> remove from nose.tools import assert_equal
 </s> add from nose.tools import assert_equal, assert_raises </s> remove     "def parentheses_util(no_left, no_right, pair_string, result):\n",
    "    # TODO: implement parentheses pairing here\n",
    "    pass\n",
    "\n",
 </s> add     "class Parentheses(object):\n", </s> remove     "    def test_pair_parentheses(self, solution):\n",
    "        assert_equal(solution(0), set([]))\n",
    "        assert_equal(solution(1), set(['()']))\n",
    "        assert_equal(solution(2), set(['(())', \n",
    "                                       '()()']))\n",
    "        assert_equal(solution(3), set(['((()))', \n",
    "                                       '(()())', \n",
    "                                       '(())()', \n",
    "                                       '()(())', \n",
    "                                       '()()()']))\n",
 </s> add     "    def test_pair_parentheses(self):\n",
    "        parentheses = Parentheses()\n",
    "        assert_raises(TypeError, parentheses.find_pair, None)\n",
    "        assert_raises(ValueError, parentheses.find_pair, -1)\n",
    "        assert_equal(parentheses.find_pair(0), [])\n",
    "        assert_equal(parentheses.find_pair(1), ['()'])\n",
    "        assert_equal(parentheses.find_pair(2), ['(())',\n",
    "                                                '()()'])\n",
    "        assert_equal(parentheses.find_pair(3), ['((()))',\n",
    "                                                '(()())',\n",
    "                                                '(())()',\n",
    "                                                '()(())',\n",
    "                                                '()()()'])\n", </s> remove     "    def test_pair_parentheses(self, solution):\n",
    "        assert_equal(solution(0), set([]))\n",
    "        assert_equal(solution(1), set(['()']))\n",
    "        assert_equal(solution(2), set(['(())', \n",
    "                                       '()()']))\n",
    "        assert_equal(solution(3), set(['((()))', \n",
    "                                       '(()())', \n",
    "                                       '(())()', \n",
    "                                       '()(())', \n",
    "                                       '()()()']))\n",
 </s> add     "    def test_pair_parentheses(self):\n",
    "        parentheses = Parentheses()\n",
    "        assert_raises(TypeError, parentheses.find_pair, None)\n",
    "        assert_raises(ValueError, parentheses.find_pair, -1)\n",
    "        assert_equal(parentheses.find_pair(0), [])\n",
    "        assert_equal(parentheses.find_pair(1), ['()'])\n",
    "        assert_equal(parentheses.find_pair(2), ['(())',\n",
    "                                                '()()'])\n",
    "        assert_equal(parentheses.find_pair(3), ['((()))',\n",
    "                                                '(()())',\n",
    "                                                '(())()',\n",
    "                                                '()(())',\n",
    "                                                '()()()'])\n",
    "from nose.tools import assert_equal, assert_raises\n",
     },
     "outputs": [],
     "source": [
      "# %load test_n_pairs_parentheses.py\n",
    "from nose.tools import assert_equal, assert_raises\n",
      "\n",
      "\n",
      "class TestPairParentheses(object):\n",
      "\n",
      "    def test_pair_parentheses(self, solution):\n",
keep keep keep keep replace keep keep keep keep keep
 Rework n pairs parens challenge (#145) 
recursion_dynamic/n_pairs_parentheses/n_pairs_parentheses_challenge.ipynb