Add steps challenge

This commit is contained in:
Donne Martin
2017-03-27 05:19:37 -04:00
parent abc982d360
commit a0afa5c9d9
4 changed files with 425 additions and 0 deletions

View 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()