mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-03 16:08:02 +00:00
Updated tests to use nose.
This commit is contained in:
@@ -90,12 +90,19 @@
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def test():\n",
|
||||
" print(unique_chars(''))\n",
|
||||
" print(unique_chars('foo'))\n",
|
||||
" print(unique_chars('bar'))\n",
|
||||
"from nose.tools import assert_equal\n",
|
||||
"\n",
|
||||
"test()"
|
||||
"class Test(object):\n",
|
||||
" def test_unique_chars(self):\n",
|
||||
" assert_equal(unique_chars(''), True)\n",
|
||||
" assert_equal(unique_chars('foo'), False)\n",
|
||||
" assert_equal(unique_chars('bar'), True) \n",
|
||||
"\n",
|
||||
"def run_tests():\n",
|
||||
" test = Test()\n",
|
||||
" test.test_unique_chars()\n",
|
||||
"\n",
|
||||
"run_tests()"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -146,7 +153,7 @@
|
||||
" chars_set.add(char)\n",
|
||||
" return True\n",
|
||||
"\n",
|
||||
"test()"
|
||||
"run_tests()"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -189,7 +196,7 @@
|
||||
" return False\n",
|
||||
" return True\n",
|
||||
"\n",
|
||||
"test()"
|
||||
"run_tests()"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user