Add mult other numbers challenge

This commit is contained in:
Donne Martin
2017-03-29 04:31:17 -04:00
parent fbe2fcc167
commit 5b65a8a955
4 changed files with 459 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from nose.tools import assert_equal, assert_raises
class TestMultOtherNumbers(object):
def test_mult_other_numbers(self):
solution = Solution()
assert_raises(TypeError, solution.mult_other_numbers, None)
assert_equal(solution.mult_other_numbers([0]), [])
assert_equal(solution.mult_other_numbers([0, 1]), [1, 0])
assert_equal(solution.mult_other_numbers([0, 1, 2]), [2, 0, 0])
assert_equal(solution.mult_other_numbers([1, 2, 3, 4]), [24, 12, 8, 6])
print('Success: test_mult_other_numbers')
def main():
test = TestMultOtherNumbers()
test.test_mult_other_numbers()
if __name__ == '__main__':
main()