|
12 | 12 | import pytest |
13 | 13 | from aiohttp.test_utils import TestClient |
14 | 14 | from aioresponses import aioresponses as AioResponsesMock # noqa: N812 |
| 15 | +from deepdiff import DeepDiff |
15 | 16 | from models_library.api_schemas_directorv2.computations import TasksOutputs |
16 | 17 | from models_library.api_schemas_webserver.projects import ProjectGet |
17 | 18 | from models_library.utils.fastapi_encoders import jsonable_encoder |
@@ -109,55 +110,62 @@ async def test_io_workflow( |
109 | 110 | ports_meta, error = await assert_status(resp, expected_status_code=expected) |
110 | 111 |
|
111 | 112 | if not error: |
112 | | - assert ports_meta == [ |
113 | | - { |
114 | | - "key": "38a0d401-af4b-4ea7-ab4c-5005c712a546", |
115 | | - "kind": "input", |
116 | | - "content_schema": { |
117 | | - "description": "Input integer value", |
118 | | - "title": "X", |
119 | | - "type": "integer", |
| 113 | + diff = DeepDiff( |
| 114 | + ports_meta, |
| 115 | + [ |
| 116 | + { |
| 117 | + "key": "38a0d401-af4b-4ea7-ab4c-5005c712a546", |
| 118 | + "kind": "input", |
| 119 | + "content_schema": { |
| 120 | + "description": "Input integer value", |
| 121 | + "title": "X", |
| 122 | + "type": "integer", |
| 123 | + }, |
120 | 124 | }, |
121 | | - }, |
122 | | - { |
123 | | - "key": "fc48252a-9dbb-4e07-bf9a-7af65a18f612", |
124 | | - "kind": "input", |
125 | | - "content_schema": { |
126 | | - "description": "Input integer value", |
127 | | - "title": "Z", |
128 | | - "type": "integer", |
| 125 | + { |
| 126 | + "key": "fc48252a-9dbb-4e07-bf9a-7af65a18f612", |
| 127 | + "kind": "input", |
| 128 | + "content_schema": { |
| 129 | + "description": "Input integer value", |
| 130 | + "title": "Z", |
| 131 | + "type": "integer", |
| 132 | + }, |
129 | 133 | }, |
130 | | - }, |
131 | | - { |
132 | | - "key": "7bf0741f-bae4-410b-b662-fc34b47c27c9", |
133 | | - "kind": "input", |
134 | | - "content_schema": { |
135 | | - "description": "Input boolean value", |
136 | | - "title": "on", |
137 | | - "type": "boolean", |
| 134 | + { |
| 135 | + "key": "7bf0741f-bae4-410b-b662-fc34b47c27c9", |
| 136 | + "kind": "input", |
| 137 | + "content_schema": { |
| 138 | + "description": "Input boolean value", |
| 139 | + "title": "on", |
| 140 | + "type": "boolean", |
| 141 | + }, |
138 | 142 | }, |
139 | | - }, |
140 | | - { |
141 | | - "key": "09fd512e-0768-44ca-81fa-0cecab74ec1a", |
142 | | - "kind": "output", |
143 | | - "content_schema": { |
144 | | - "description": "Output integer value", |
145 | | - "title": "Random sleep interval_2", |
146 | | - "type": "integer", |
| 143 | + { |
| 144 | + "key": "09fd512e-0768-44ca-81fa-0cecab74ec1a", |
| 145 | + "kind": "output", |
| 146 | + "content_schema": { |
| 147 | + "description": "Output integer value", |
| 148 | + "title": "Random sleep interval_2", |
| 149 | + "type": "integer", |
| 150 | + }, |
147 | 151 | }, |
148 | | - }, |
149 | | - { |
150 | | - "key": "76f607b4-8761-4f96-824d-cab670bc45f5", |
151 | | - "kind": "output", |
152 | | - "content_schema": { |
153 | | - "description": "Output integer value", |
154 | | - "title": "Random sleep interval", |
155 | | - "type": "integer", |
| 152 | + { |
| 153 | + "key": "76f607b4-8761-4f96-824d-cab670bc45f5", |
| 154 | + "kind": "output", |
| 155 | + "content_schema": { |
| 156 | + "description": "Output integer value", |
| 157 | + "title": "Random sleep interval", |
| 158 | + "type": "integer", |
| 159 | + }, |
156 | 160 | }, |
157 | | - }, |
158 | | - ] |
| 161 | + ], |
| 162 | + ignore_order=True, |
| 163 | + ) |
159 | 164 |
|
160 | | - assert ports_meta == PROJECTS_METADATA_PORTS_RESPONSE_BODY_DATA |
| 165 | + assert not diff |
| 166 | + assert not DeepDiff( |
| 167 | + ports_meta, PROJECTS_METADATA_PORTS_RESPONSE_BODY_DATA, ignore_order=True |
| 168 | + ) |
161 | 169 |
|
162 | 170 | # get_project_inputs |
163 | 171 | expected_url = client.app.router["get_project_inputs"].url_for( |
|
0 commit comments