mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-05 08:58:02 +00:00
@@ -74,9 +74,7 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"class Solution(object):\n",
|
||||
@@ -103,24 +101,22 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# %load test_sub_two.py\n",
|
||||
"from nose.tools import assert_equal, assert_raises\n",
|
||||
"import unittest\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestSubTwo(object):\n",
|
||||
"class TestSubTwo(unittest.TestCase):\n",
|
||||
"\n",
|
||||
" def test_sub_two(self):\n",
|
||||
" solution = Solution()\n",
|
||||
" assert_raises(TypeError, solution.sub_two, None)\n",
|
||||
" assert_equal(solution.sub_two(7, 5), 2)\n",
|
||||
" assert_equal(solution.sub_two(-5, -7), 2)\n",
|
||||
" assert_equal(solution.sub_two(-5, 7), -12)\n",
|
||||
" assert_equal(solution.sub_two(5, -7), 12)\n",
|
||||
" self.assertRaises(TypeError, solution.sub_two, None)\n",
|
||||
" self.assertEqual(solution.sub_two(7, 5), 2)\n",
|
||||
" self.assertEqual(solution.sub_two(-5, -7), 2)\n",
|
||||
" self.assertEqual(solution.sub_two(-5, 7), -12)\n",
|
||||
" self.assertEqual(solution.sub_two(5, -7), 12)\n",
|
||||
" print('Success: test_sub_two')\n",
|
||||
"\n",
|
||||
"\n",
|
||||
@@ -159,9 +155,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