mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-02 23:48:02 +00:00
23 lines
673 B
Python
23 lines
673 B
Python
import unittest
|
|
|
|
|
|
class TestMultOtherNumbers(unittest.TestCase):
|
|
|
|
def test_mult_other_numbers(self):
|
|
solution = Solution()
|
|
self.assertRaises(TypeError, solution.mult_other_numbers, None)
|
|
self.assertEqual(solution.mult_other_numbers([0]), [])
|
|
self.assertEqual(solution.mult_other_numbers([0, 1]), [1, 0])
|
|
self.assertEqual(solution.mult_other_numbers([0, 1, 2]), [2, 0, 0])
|
|
self.assertEqual(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()
|