|
1 | 1 | from collections import OrderedDict
|
| 2 | +import collections |
2 | 3 | import inspect
|
3 | 4 | import json
|
4 |
| -import unittest |
5 |
| -import collections |
6 | 5 | import os
|
| 6 | +import unittest |
7 | 7 | import plotly
|
8 | 8 |
|
9 | 9 | from dash.development.base_component import (
|
@@ -164,60 +164,60 @@ def test_to_plotly_json_with_nested_children_with_mixed_strings_and_without_list
|
164 | 164 | Component._type
|
165 | 165 |
|
166 | 166 | self.assertEqual(json.loads(json.dumps(
|
167 |
| - c.to_plotly_json(), |
168 |
| - cls=plotly.utils.PlotlyJSONEncoder |
| 167 | + c.to_plotly_json(), |
| 168 | + cls=plotly.utils.PlotlyJSONEncoder |
169 | 169 | )), {
|
170 |
| - 'type': 'TestComponent', |
171 |
| - 'namespace': 'test_namespace', |
172 |
| - 'props': { |
173 |
| - 'children': [ |
174 |
| - { |
175 |
| - 'type': 'TestComponent', |
176 |
| - 'namespace': 'test_namespace', |
177 |
| - 'props': { |
178 |
| - 'id': '0.0' |
179 |
| - } |
180 |
| - }, |
181 |
| - { |
182 |
| - 'type': 'TestComponent', |
183 |
| - 'namespace': 'test_namespace', |
184 |
| - 'props': { |
185 |
| - 'children': { |
186 |
| - 'type': 'TestComponent', |
187 |
| - 'namespace': 'test_namespace', |
188 |
| - 'props': { |
189 |
| - 'children': { |
190 |
| - 'type': 'TestComponent', |
191 |
| - 'namespace': 'test_namespace', |
192 |
| - 'props': { |
193 |
| - 'children': [ |
194 |
| - 10, |
195 |
| - None, |
196 |
| - 'wrap string', |
197 |
| - { |
198 |
| - 'type': 'TestComponent', |
199 |
| - 'namespace': 'test_namespace', # noqa: E501 |
200 |
| - 'props': { |
201 |
| - 'children': 'string', |
202 |
| - 'id': '0.1.x.x.0' |
203 |
| - } |
204 |
| - }, |
205 |
| - 'another string', |
206 |
| - 4.51 |
207 |
| - ], |
208 |
| - 'id': '0.1.x.x' |
209 |
| - } |
210 |
| - }, |
211 |
| - 'id': '0.1.x' |
212 |
| - } |
213 |
| - }, |
214 |
| - 'id': '0.1' |
| 170 | + 'type': 'TestComponent', |
| 171 | + 'namespace': 'test_namespace', |
| 172 | + 'props': { |
| 173 | + 'children': [ |
| 174 | + { |
| 175 | + 'type': 'TestComponent', |
| 176 | + 'namespace': 'test_namespace', |
| 177 | + 'props': { |
| 178 | + 'id': '0.0' |
| 179 | + } |
| 180 | + }, |
| 181 | + { |
| 182 | + 'type': 'TestComponent', |
| 183 | + 'namespace': 'test_namespace', |
| 184 | + 'props': { |
| 185 | + 'children': { |
| 186 | + 'type': 'TestComponent', |
| 187 | + 'namespace': 'test_namespace', |
| 188 | + 'props': { |
| 189 | + 'children': { |
| 190 | + 'type': 'TestComponent', |
| 191 | + 'namespace': 'test_namespace', |
| 192 | + 'props': { |
| 193 | + 'children': [ |
| 194 | + 10, |
| 195 | + None, |
| 196 | + 'wrap string', |
| 197 | + { |
| 198 | + 'type': 'TestComponent', |
| 199 | + 'namespace': 'test_namespace', # noqa: E501 |
| 200 | + 'props': { |
| 201 | + 'children': 'string', |
| 202 | + 'id': '0.1.x.x.0' |
| 203 | + } |
| 204 | + }, |
| 205 | + 'another string', |
| 206 | + 4.51 |
| 207 | + ], |
| 208 | + 'id': '0.1.x.x' |
| 209 | + } |
| 210 | + }, |
| 211 | + 'id': '0.1.x' |
| 212 | + } |
| 213 | + }, |
| 214 | + 'id': '0.1' |
| 215 | + } |
215 | 216 | }
|
216 |
| - } |
217 |
| - ], |
218 |
| - 'id': '0' |
219 |
| - } |
220 |
| - }) |
| 217 | + ], |
| 218 | + 'id': '0' |
| 219 | + } |
| 220 | + }) |
221 | 221 |
|
222 | 222 | def test_get_item_raises_key_if_id_doesnt_exist(self):
|
223 | 223 | c = Component()
|
@@ -754,4 +754,4 @@ def assert_docstring(assertEqual, docstring):
|
754 | 754 | "Available events: 'restyle', 'relayout', 'click'",
|
755 | 755 | ' '
|
756 | 756 | ])[i]
|
757 |
| - ) |
| 757 | + ) |
0 commit comments