52 lines
1.2 KiB
Python
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()
|