mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-05 00:48:03 +00:00
@@ -113,9 +113,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"class Solution(object):\n",
|
||||
@@ -142,24 +140,22 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# %load test_length_longest_path.py\n",
|
||||
"from nose.tools import assert_equal, assert_raises\n",
|
||||
"import unittest\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestSolution(object):\n",
|
||||
"class TestSolution(unittest.TestCase):\n",
|
||||
"\n",
|
||||
" def test_length_longest_path(self):\n",
|
||||
" solution = Solution()\n",
|
||||
" assert_raises(TypeError, solution.length_longest_path, None)\n",
|
||||
" assert_equal(solution.length_longest_path(''), 0)\n",
|
||||
" self.assertRaises(TypeError, solution.length_longest_path, None)\n",
|
||||
" self.assertEqual(solution.length_longest_path(''), 0)\n",
|
||||
" file_system = 'dir\\n\\tsubdir1\\n\\t\\tfile1.ext\\n\\t\\tsubsubdir1\\n\\tsubdir2\\n\\t\\tsubsubdir2\\n\\t\\t\\tfile2.ext'\n",
|
||||
" expected = 32\n",
|
||||
" assert_equal(solution.length_longest_path(file_system), expected)\n",
|
||||
" self.assertEqual(solution.length_longest_path(file_system), expected)\n",
|
||||
" print('Success: test_length_longest_path')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
@@ -198,9 +194,9 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.0"
|
||||
"version": "3.7.2"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 0
|
||||
"nbformat_minor": 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user