We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c84ca29 commit eebdb76Copy full SHA for eebdb76
tests/unit/test_response.py
@@ -2,7 +2,23 @@
2
from unittest.mock import Mock, patch
3
4
from pynetbox.core.endpoint import Endpoint
5
-from pynetbox.core.response import Record, RecordSet
+from pynetbox.core.response import Record, RecordSet, flatten_custom
6
+
7
8
+class FlattenCustomTest(unittest.TestCase):
9
+ def test_flatten_custom(self):
10
+ test_dicts = [
11
+ {"foo0": []},
12
+ {"foo1": [{"a": "b"}]},
13
+ {"foo2": [{"a": "b", "c": "d"}]},
14
+ {"foo3": 123},
15
+ {"foo4": "a"},
16
+ {"foo5": {"a": "b"}},
17
+ {"foo6": [{"a": "b", "c": "d"}]},
18
+ ]
19
+ for test_dict in test_dicts:
20
+ ret = flatten_custom(test_dict)
21
+ assert ret == test_dict
22
23
24
class RecordTestCase(unittest.TestCase):
0 commit comments