mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-07 18:08:01 +00:00
Add steps challenge
This commit is contained in:
25
recursion_dynamic/steps/test_steps.py
Normal file
25
recursion_dynamic/steps/test_steps.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from nose.tools import assert_equal, assert_raises
|
||||
|
||||
|
||||
class TestSteps(object):
|
||||
|
||||
def test_steps(self):
|
||||
steps = Steps()
|
||||
assert_raises(TypeError, steps.count_ways, None)
|
||||
assert_raises(TypeError, steps.count_ways, -1)
|
||||
assert_equal(steps.count_ways(0), 1)
|
||||
assert_equal(steps.count_ways(1), 1)
|
||||
assert_equal(steps.count_ways(2), 2)
|
||||
assert_equal(steps.count_ways(3), 4)
|
||||
assert_equal(steps.count_ways(4), 7)
|
||||
assert_equal(steps.count_ways(10), 274)
|
||||
print('Success: test_steps')
|
||||
|
||||
|
||||
def main():
|
||||
test = TestSteps()
|
||||
test.test_steps()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user