mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-13 04:48:03 +00:00
@@ -1,18 +1,18 @@
|
||||
from nose.tools import assert_equal, assert_raises
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMatrixMultiplicationCost(object):
|
||||
class TestMatrixMultiplicationCost(unittest.TestCase):
|
||||
|
||||
def test_find_min_cost(self):
|
||||
matrix_mult_cost = MatrixMultiplicationCost()
|
||||
assert_raises(TypeError, matrix_mult_cost.find_min_cost, None)
|
||||
assert_equal(matrix_mult_cost.find_min_cost([]), 0)
|
||||
self.assertRaises(TypeError, matrix_mult_cost.find_min_cost, None)
|
||||
self.assertEqual(matrix_mult_cost.find_min_cost([]), 0)
|
||||
matrices = [Matrix(2, 3),
|
||||
Matrix(3, 6),
|
||||
Matrix(6, 4),
|
||||
Matrix(4, 5)]
|
||||
expected_cost = 124
|
||||
assert_equal(matrix_mult_cost.find_min_cost(matrices), expected_cost)
|
||||
self.assertEqual(matrix_mult_cost.find_min_cost(matrices), expected_cost)
|
||||
print('Success: test_find_min_cost')
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user