      "\n",
      "def reverse_string_alt2(string):\n",
      "    if string is None:\n",
      "        return None    \n",
      "    return ''.join(reversed(string))\n",
      "\n",
      "run_tests(reverse_string_alt)\n",
      "run_tests(reverse_string_alt2)"
     ]
    },
 
</s> remove     "run_tests(reverse_string_alt)\n",
    "run_tests(reverse_string_alt2)"
 </s> add     "class Test(object):\n",
    "    def test_reversed(self, func):\n",
    "        assert_equal(func(None), None)\n",
    "        assert_equal(func(''), '')\n",
    "        assert_equal(func('foo bar'), 'rab oof')\n",
    "        print('Success: test_reversed')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_reversed(reverse_string)\n",
    "    test.test_reversed(reverse_string_alt)\n",
    "    test.test_reversed(reverse_string_alt2)" </s> remove     "        string_list[i], string_list[string_length - 1 - i] = \\\n",
    "            string_list[string_length - 1 - i], string_list[i]\n",
    "    return ''.join(string_list)\n",
    "\n",
    "run_tests(reverse_string)"
 </s> add     "        string_list[i], string_list[string_length-1-i] = \\\n",
    "            string_list[string_length-1-i], string_list[i]\n",
    "    return ''.join(string_list)" </s> remove   {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_reversed(self, func):\n",
    "        assert_equal(func(None), None)\n",
    "        assert_equal(func(''), '')\n",
    "        assert_equal(func('foo bar'), 'rab oof')\n",
    "\n",
    "def run_tests(func):\n",
    "    test = Test()\n",
    "    test.test_reversed(func)"
   ]
  },
 </s> add 
    "    return ''.join(reversed(string))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_reversed\n",
      "Success: test_reversed\n",
      "Success: test_reversed\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n",
      "\n",
      "def reverse_string_alt2(string):\n",
      "    if string is None:\n",
      "        return None    \n",
    "    return ''.join(reversed(string))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Unit Test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_reversed\n",
      "Success: test_reversed\n",
      "Success: test_reversed\n"
     ]
    }
   ],
   "source": [
    "from nose.tools import assert_equal\n",
      "\n",
      "run_tests(reverse_string_alt)\n",
      "run_tests(reverse_string_alt2)"
     ]
    },
keep keep keep keep replace keep keep keep keep keep
 Reworked notebook: Added more detail to clarifying questions and test cases.  Reworked code and unit test. 
arrays-strings/reverse_string.ipynb