     ],
     "source": [
      "from nose.tools import assert_equal\n",
      "\n",
      "class Test(object):\n",
      "    def test_is_rotation(self, func):\n",
      "        assert_equal(func('o', 'oo'), False)\n",
      "        assert_equal(func(None, 'foo'), False)\n",
      "        assert_equal(func('', 'foo'), False)\n",
      "        assert_equal(func('', ''), True)\n",
      "        assert_equal(func('foobarbaz', 'barbazfoo'), True)\n",
      "        print('Success: test_is_rotation')\n",
      "\n",
      "if __name__ == '__main__':\n",
      "    test = Test()\n",
      "    test.test_is_rotation(is_rotation)"
     ]
 
</s> remove     "    test = Test()\n",
    "    test.test_is_rotation(is_rotation)"
 </s> add     "    main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Success: test_rotation\n"
     ]
    }
   ],
   "source": [
    "%run -i test_rotation.py" </s> remove     "def is_substring(s1, s2):\n",
 </s> add     "def is_substring(s1, s2): \n", </s> remove     "* Any strings that differ in size results in False\n",
    "* NULL, 'foo' -> False (any NULL results in False)\n",
 </s> add     "* Any strings that differ in size -> False\n",
    "* None, 'foo' -> False (any None results in False)\n", </s> remove       "Success: test_is_rotation\n"
 </s> add       "Overwriting test_rotation.py\n"
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
     ],
     "source": [
      "from nose.tools import assert_equal\n",
      "\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
    "\n",
    "class TestRotation(object):\n",
    "    \n",
    "    def test_rotation(self):\n",
    "        assert_equal(is_rotation('o', 'oo'), False)\n",
    "        assert_equal(is_rotation(None, 'foo'), False)\n",
    "        assert_equal(is_rotation('', 'foo'), False)\n",
    "        assert_equal(is_rotation('', ''), True)\n",
    "        assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)\n",
    "        print('Success: test_rotation')\n",
    "\n",
    "def main():\n",
    "    test = TestRotation()\n",
    "    test.test_rotation()\n",
      "\n",
      "if __name__ == '__main__':\n",
      "    test = Test()\n",
      "    test.test_is_rotation(is_rotation)"
     ]
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 Added rotation challenge and solution. 
arrays_strings/rotation/rotation_solution.ipynb