52 lines
1.2 KiB
Python
Raw Permalink Normal View History

2025-01-24 15:51:12 +01:00
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()