mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Updated Algorithm section and expanded the Unit Test section.
This commit is contained in:
parent
c8e65593d4
commit
b0a42468f1
@ -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()"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user