This commit is contained in:
51
tests/test_ex4.py
Normal file
51
tests/test_ex4.py
Normal file
@ -0,0 +1,51 @@
|
||||
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()
|
Reference in New Issue
Block a user