AlgoDS-Examen2024/tests/test_ex4.py
LordBaryhobal 307c46d86a
All checks were successful
Python unit tests / unittests (push) Successful in 5s
added exercise 4
2025-01-24 15:51:12 +01:00

52 lines
1.2 KiB
Python

import unittest
from src.ex4_furniture import minimumMoves
class MyTestCase(unittest.TestCase):
def test_simple1(self):
current_plan = [
[0, 0, 0, 0],
[2, 0, 1, 0],
[0, 0, 1, 0]
]
target_plan = [
[0, 0, 2, 0],
[0, 1, 0, 0],
[0, 1, 0 ,0]
]
self.assertEqual(
minimumMoves(current_plan, target_plan),
[
[
[0, 0, 0, 0],
[2, 0, 1, 0],
[0, 0, 1, 0]
],
[
[2, 0, 0, 0],
[0, 0, 1, 0],
[0, 0, 1, 0]
],
[
[0, 2, 0, 0],
[0, 0, 1, 0],
[0, 0, 1, 0]
],
[
[0, 0, 2, 0],
[0, 0, 1, 0],
[0, 0, 1, 0]
],
[
[0, 0, 2, 0],
[0, 1, 0, 0],
[0, 1, 0, 0]
],
]
)
if __name__ == '__main__':
unittest.main()