Updated Algorithm section and expanded the Unit Test section.

This commit is contained in:
Donne Martin 2015-06-29 20:36:26 -04:00
parent c8e65593d4
commit b0a42468f1

View File

@ -56,7 +56,7 @@
"source": [
"## Algorithm\n",
"\n",
"Refer to the solution notebook for the algorithm."
"Refer to the solution notebook. If you are stuck and need a hint, the solution notebook's algorithm discussion might be a good place to start."
]
},
{
@ -108,7 +108,26 @@
},
"outputs": [],
"source": [
"%load test_rotation.py"
"# %load test_rotation.py\n",
"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",
"if __name__ == '__main__':\n",
" main()"
]
}
],