|
1 | 1 | import pytest |
2 | 2 |
|
3 | 3 | from json_to_models.dynamic_typing import (BooleanString, DDict, DList, DOptional, DTuple, DUnion, FloatString, |
4 | | - IntString, NoneType, Unknown) |
| 4 | + IntString, Null, Unknown) |
5 | 5 | from json_to_models.generator import MetadataGenerator |
6 | 6 |
|
7 | 7 | # MetaData | Optimized MetaData |
|
16 | 16 | {'1': DUnion( |
17 | 17 | {'a': DUnion({'b': int}, {'b': float})}, |
18 | 18 | {'a': DUnion({'b': float}, {'b': int})}, |
19 | | - {'a': NoneType}, |
| 19 | + {'a': Null}, |
20 | 20 | )}, |
21 | 21 | {'1': {'a': DOptional({'b': float})}}, |
22 | 22 | id="merge_nested_dicts" |
|
72 | 72 | id="list_unknown_vs_multi" |
73 | 73 | ), |
74 | 74 | pytest.param( |
75 | | - DUnion(NoneType, str), |
| 75 | + DUnion(Null, str), |
76 | 76 | DOptional(str), |
77 | 77 | id="optional_str" |
78 | 78 | ), |
79 | 79 | pytest.param( |
80 | | - DUnion(NoneType, DList(str)), |
| 80 | + DUnion(Null, DList(str)), |
81 | 81 | DOptional(DList(str)), |
82 | 82 | id="optional_list" |
83 | 83 | ), |
84 | 84 | pytest.param( |
85 | | - DList(DUnion(NoneType, str)), |
| 85 | + DList(DUnion(Null, str)), |
86 | 86 | DList(DOptional(str)), |
87 | 87 | id="list_of_optional_strings" |
88 | 88 | ), |
89 | 89 | pytest.param( |
90 | | - DUnion(NoneType, DList(str), int), |
| 90 | + DUnion(Null, DList(str), int), |
91 | 91 | DOptional(DUnion(DList(str), int)), |
92 | 92 | id="optional_list_or_int" |
93 | 93 | ), |
94 | 94 | pytest.param( |
95 | | - DUnion(NoneType, DList(DUnion(str, int))), |
| 95 | + DUnion(Null, DList(DUnion(str, int))), |
96 | 96 | DOptional(DList(DUnion(str, int))), |
97 | 97 | id="optional_list_of_str_or_int" |
98 | 98 | ), |
99 | 99 | pytest.param( |
100 | | - DList(DUnion(NoneType, str, int)), |
| 100 | + DList(DUnion(Null, str, int)), |
101 | 101 | DList(DOptional(DUnion(str, int))), |
102 | 102 | id="list_of_optional_strings_ot_int" |
103 | 103 | ), |
|
112 | 112 | id="optional_union_nested" |
113 | 113 | ), |
114 | 114 | pytest.param( |
115 | | - DUnion(NoneType, str, NoneType), |
| 115 | + DUnion(Null, str, Null), |
116 | 116 | DOptional(str), |
117 | 117 | id="optional_str" |
118 | 118 | ), |
|
0 commit comments