#273: Remove nose dependency for linked_lists/ (#275)

This commit is contained in:
Donne Martin
2020-07-06 21:09:04 -04:00
committed by GitHub
parent b598f474af
commit 0e7ed80228
25 changed files with 283 additions and 383 deletions

View File

@@ -89,9 +89,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"class MyLinkedList(LinkedList):\n",
@@ -120,26 +118,24 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# %load test_remove_duplicates.py\n",
"from nose.tools import assert_equal\n",
"import unittest\n",
"\n",
"\n",
"class TestRemoveDupes(object):\n",
"class TestRemoveDupes(unittest.TestCase):\n",
"\n",
" def test_remove_dupes(self, linked_list):\n",
" print('Test: Empty list')\n",
" linked_list.remove_dupes()\n",
" assert_equal(linked_list.get_all_data(), [])\n",
" self.assertEqual(linked_list.get_all_data(), [])\n",
"\n",
" print('Test: One element list')\n",
" linked_list.insert_to_front(2)\n",
" linked_list.remove_dupes()\n",
" assert_equal(linked_list.get_all_data(), [2])\n",
" self.assertEqual(linked_list.get_all_data(), [2])\n",
"\n",
" print('Test: General case, duplicates')\n",
" linked_list.insert_to_front(1)\n",
@@ -150,11 +146,11 @@
" linked_list.insert_to_front(1)\n",
" linked_list.insert_to_front(1)\n",
" linked_list.remove_dupes()\n",
" assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
" self.assertEqual(linked_list.get_all_data(), [1, 3, 2])\n",
"\n",
" print('Test: General case, no duplicates')\n",
" linked_list.remove_dupes()\n",
" assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
" self.assertEqual(linked_list.get_all_data(), [1, 3, 2])\n",
"\n",
" print('Success: test_remove_dupes\\n')\n",
"\n",
@@ -195,9 +191,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
}