|
15 | 15 | # assert server.compare_image(3, abs_path) == True
|
16 | 16 |
|
17 | 17 |
|
18 |
| -# def test_create_object_pipeline(server): |
19 |
| -# server.call("create_object_pipeline", [{"id": "123456", "file_name": "hat.vtp"}]) |
20 |
| -# abs_path = os.path.join(images_dir_path, "create_object_pipeline.jpeg") |
21 |
| -# assert server.compare_image(3, abs_path) == True |
22 |
| - |
23 |
| - |
24 |
| -# def test_delete_object_pipeline(server): |
25 |
| -# server.call("create_object_pipeline", [{"id": "123456789", "file_name": "hat.vtp"}]) |
26 |
| -# abs_path = os.path.join(images_dir_path, "create_object_pipeline.jpeg") |
27 |
| -# assert server.compare_image(3, abs_path) == True |
28 |
| - |
29 |
| -# server.call("delete_object_pipeline", [{"id": "123456789"}]) |
30 |
| -# abs_path = os.path.join(images_dir_path, "delete_object_pipeline.jpeg") |
31 |
| -# assert server.compare_image(3, abs_path) == True |
32 |
| - |
33 |
| - |
34 |
| -# def test_toggle_object_visibility(server): |
35 |
| -# server.call("create_object_pipeline", [{"id": "123456789", "file_name": "hat.vtp"}]) |
36 |
| -# abs_path = os.path.join(images_dir_path, "create_object_pipeline.jpeg") |
37 |
| -# assert server.compare_image(3, abs_path) == True |
38 |
| - |
39 |
| -# server.call("toggle_object_visibility", [{"id": "123456789", "is_visible": False}]) |
40 |
| -# abs_path = os.path.join(images_dir_path, "toggle_object_visibility_1.jpeg") |
41 |
| -# assert server.compare_image(3, abs_path) == True |
42 |
| - |
43 |
| -# server.call("toggle_object_visibility", [{"id": "123456789", "is_visible": True}]) |
44 |
| -# abs_path = os.path.join(images_dir_path, "toggle_object_visibility_2.jpeg") |
45 |
| -# assert server.compare_image(3, abs_path) == True |
46 |
| - |
47 |
| - |
48 |
| -# def test_apply_textures(server): |
49 |
| - |
50 |
| -# server.call( |
51 |
| -# "create_object_pipeline", |
52 |
| -# [{"id": "123456789", "file_name": "emperor_penguin.vtp"}], |
53 |
| -# ) |
54 |
| -# abs_path = os.path.join(images_dir_path, "apply_textures_1.jpeg") |
55 |
| -# assert server.compare_image(3, abs_path) == True |
56 |
| - |
57 |
| -# server.call( |
58 |
| -# "apply_textures", |
59 |
| -# [ |
60 |
| -# { |
61 |
| -# "id": "123456789", |
62 |
| -# "textures": [ |
63 |
| -# { |
64 |
| -# "texture_name": "PenguinMat", |
65 |
| -# "texture_file_name": "penguin_colors.vti", |
66 |
| -# } |
67 |
| -# ], |
68 |
| -# } |
69 |
| -# ], |
70 |
| -# ) |
71 |
| -# abs_path = os.path.join(images_dir_path, "apply_textures_2.jpeg") |
72 |
| -# assert server.compare_image(3, abs_path) == True |
73 |
| - |
74 |
| - |
75 |
| -# def test_get_point_position(server): |
76 |
| - |
77 |
| -# server.call( |
78 |
| -# "create_object_pipeline", |
79 |
| -# [{"id": "123456789", "file_name": "hat.vtp"}], |
80 |
| -# ) |
81 |
| -# abs_path = os.path.join(images_dir_path, "get_point_position.jpeg") |
82 |
| -# assert server.compare_image(3, abs_path) == True |
83 |
| - |
84 |
| -# server.call("get_point_position", [{"x": 0, "y": 0}]) |
85 |
| -# response = server.get_response() |
86 |
| -# assert "x" in response["result"] |
87 |
| -# assert "y" in response["result"] |
88 |
| -# assert "z" in response["result"] |
89 |
| -# x = response["result"]["x"] |
90 |
| -# y = response["result"]["y"] |
91 |
| -# z = response["result"]["z"] |
92 |
| -# assert type(x) is float |
93 |
| -# assert type(y) is float |
94 |
| -# assert type(z) is float |
| 18 | +def test_create_object_pipeline(server): |
| 19 | + server.call("create_object_pipeline", [{"id": "123456", "file_name": "hat.vtp"}]) |
| 20 | + abs_path = os.path.join(images_dir_path, "create_object_pipeline.jpeg") |
| 21 | + assert server.compare_image(3, abs_path) == True |
| 22 | + |
| 23 | + |
| 24 | +def test_delete_object_pipeline(server): |
| 25 | + server.call("create_object_pipeline", [{"id": "123456789", "file_name": "hat.vtp"}]) |
| 26 | + abs_path = os.path.join(images_dir_path, "create_object_pipeline.jpeg") |
| 27 | + assert server.compare_image(3, abs_path) == True |
| 28 | + |
| 29 | + server.call("delete_object_pipeline", [{"id": "123456789"}]) |
| 30 | + abs_path = os.path.join(images_dir_path, "delete_object_pipeline.jpeg") |
| 31 | + assert server.compare_image(3, abs_path) == True |
| 32 | + |
| 33 | + |
| 34 | +def test_toggle_object_visibility(server): |
| 35 | + server.call("create_object_pipeline", [{"id": "123456789", "file_name": "hat.vtp"}]) |
| 36 | + abs_path = os.path.join(images_dir_path, "create_object_pipeline.jpeg") |
| 37 | + assert server.compare_image(3, abs_path) == True |
| 38 | + |
| 39 | + server.call("toggle_object_visibility", [{"id": "123456789", "is_visible": False}]) |
| 40 | + abs_path = os.path.join(images_dir_path, "toggle_object_visibility_1.jpeg") |
| 41 | + assert server.compare_image(3, abs_path) == True |
| 42 | + |
| 43 | + server.call("toggle_object_visibility", [{"id": "123456789", "is_visible": True}]) |
| 44 | + abs_path = os.path.join(images_dir_path, "toggle_object_visibility_2.jpeg") |
| 45 | + assert server.compare_image(3, abs_path) == True |
| 46 | + |
| 47 | + |
| 48 | +def test_apply_textures(server): |
| 49 | + |
| 50 | + server.call( |
| 51 | + "create_object_pipeline", |
| 52 | + [{"id": "123456789", "file_name": "emperor_penguin.vtp"}], |
| 53 | + ) |
| 54 | + abs_path = os.path.join(images_dir_path, "apply_textures_1.jpeg") |
| 55 | + assert server.compare_image(3, abs_path) == True |
| 56 | + |
| 57 | + server.call( |
| 58 | + "apply_textures", |
| 59 | + [ |
| 60 | + { |
| 61 | + "id": "123456789", |
| 62 | + "textures": [ |
| 63 | + { |
| 64 | + "texture_name": "PenguinMat", |
| 65 | + "texture_file_name": "penguin_colors.vti", |
| 66 | + } |
| 67 | + ], |
| 68 | + } |
| 69 | + ], |
| 70 | + ) |
| 71 | + abs_path = os.path.join(images_dir_path, "apply_textures_2.jpeg") |
| 72 | + assert server.compare_image(3, abs_path) == True |
| 73 | + |
| 74 | + |
| 75 | +def test_get_point_position(server): |
| 76 | + |
| 77 | + server.call( |
| 78 | + "create_object_pipeline", |
| 79 | + [{"id": "123456789", "file_name": "hat.vtp"}], |
| 80 | + ) |
| 81 | + abs_path = os.path.join(images_dir_path, "get_point_position.jpeg") |
| 82 | + assert server.compare_image(3, abs_path) == True |
| 83 | + |
| 84 | + server.call("get_point_position", [{"x": 0, "y": 0}]) |
| 85 | + response = server.get_response() |
| 86 | + assert "x" in response["result"] |
| 87 | + assert "y" in response["result"] |
| 88 | + assert "z" in response["result"] |
| 89 | + x = response["result"]["x"] |
| 90 | + y = response["result"]["y"] |
| 91 | + z = response["result"]["z"] |
| 92 | + assert type(x) is float |
| 93 | + assert type(y) is float |
| 94 | + assert type(z) is float |
0 commit comments