# coding: utf-8
import pytest

from mmvdApp.visualization import Visualization


@pytest.mark.frontend
def test_magazine_class():
    map_ = \
        [
            [2, 2, 2, 2, 3],
            [1, "a", 3, "b", 3],
            [1, "c", 3, "d", 3],
            [1, "e", 3, "f", 3],
            [1, 4, 4, 4, 9],
        ]
    app = Visualization(map_)
    robots = ((0, 0), (1, 1), (2, 3), (4, 2))
    app.draw_robots(robots)
    app.animate([[0, 2], [1, 2], [2, 3], [3, 3]], [["a", 3]])
    app.animate([[0, 2], [1, 3], [2, 4], [3, 3]], [["b", 0]])
    app.animate([[0, 2], [1, 3], [2, 4], [3, 4]], [["c", 0]])
    app.animate([[0, 2], [1, 3], [2, 1]], [["d", 2]])
    # new robots are given new id numbers
    app.draw_robots(robots)
    # in order to move new robots one has to use proper id
    app.animate([[4, 2], [5, 3], [6, 1]], [["d", 2]])
    app.animate([[0, 3]], [])
    app.animate([[0, 3]], [])
    app.animate([[0, 3]], [])
    app.animate([[0, 3]], [])
    app.animate([[0, 4]], [])
    app.animate([[0, 4]], [])
    app.animate([[0, 4]], [])
    app.animate([[0, 4]], [])
    app.animate([[0, 1]], [])
    app.animate([[0, 1]], [])
    app.animate([[0, 1]], [])
    app.animate([[0, 1]], [])
    app.animate([[0, 2]], [])
    app.animate([[0, 2]], [])
    app.animate([[0, 2]], [])
    app.animate([[0, 2]], [])
@@ -124,200 +124,24 @@
 ass(
-):%0A    map_ = %5C%0A        %5B%0A            %5B2, 2, 2, 2, 3%5D,%0A            %5B1, %22a%22, 3, %22b%22, 3%5D,%0A            %5B1, %22c%22, 3, %22d%22, 3%5D,%0A            %5B1, %22e%22, 3, %22f%22, 3%5D,%0A            %5B1, 4, 4, 4, 9%5D,%0A        %5D
+warehouse_map1):
 %0A   
@@ -165,12 +165,22 @@
 ion(
+warehouse_
 map
-_
+1
 )%0A  
@@ -1133,28 +1133,29 @@
    app.animate(%5B%5B0, 2%5D%5D, %5B%5D)
+%0A

use established warehouse map in frontend test