mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-09 02:48:02 +00:00
@@ -1,12 +1,12 @@
|
||||
from nose.tools import assert_equal
|
||||
import unittest
|
||||
|
||||
|
||||
class TestGridPath(object):
|
||||
class TestGridPath(unittest.TestCase):
|
||||
|
||||
def test_grid_path(self):
|
||||
grid = Grid()
|
||||
assert_equal(grid.find_path(None), None)
|
||||
assert_equal(grid.find_path([[]]), None)
|
||||
self.assertEqual(grid.find_path(None), None)
|
||||
self.assertEqual(grid.find_path([[]]), None)
|
||||
max_rows = 8
|
||||
max_cols = 4
|
||||
matrix = [[1] * max_cols for _ in range(max_rows)]
|
||||
@@ -23,10 +23,10 @@ class TestGridPath(object):
|
||||
(2, 1), (3, 1), (4, 1),
|
||||
(5, 1), (5, 2), (6, 2),
|
||||
(7, 2), (7, 3)]
|
||||
assert_equal(result, expected)
|
||||
self.assertEqual(result, expected)
|
||||
matrix[7][2] = 0
|
||||
result = grid.find_path(matrix)
|
||||
assert_equal(result, None)
|
||||
self.assertEqual(result, None)
|
||||
print('Success: test_grid_path')
|
||||
|
||||
|
||||
@@ -36,4 +36,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user