AlgoDS-Examen2025/tests/test_ex2.py

21 lines
485 B
Python
Raw Normal View History

2025-01-28 12:52:19 +01:00
import unittest
2025-01-28 14:32:19 +01:00
from Ex2 import findSafestPath
2025-01-28 12:52:19 +01:00
class MyTestCase(unittest.TestCase):
def test_simple1(self):
2025-01-28 14:32:19 +01:00
self.assertEqual(
findSafestPath(0, 2, [(0, 1, -1), (1, 2, 0)]),
[0, 0, 1, 2]
)
def test_simple2(self):
self.assertEqual(
findSafestPath(0, 5, [(0,1,0), (0,2,1), (2,1,-1), (1,3,-1), (2,4,-1), (3,5,1), (3,4,0), (4,5,-1)]),
[0, 1, 3, 5]
)
2025-01-28 12:52:19 +01:00
if __name__ == '__main__':
unittest.main()