1
0
mirror of synced 2026-01-06 06:04:16 -05:00

CDK: make TypeTransformer more robust to incorrect incoming records (#16544)

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
This commit is contained in:
Serhii Chvaliuk
2022-09-13 10:30:16 +03:00
committed by GitHub
parent 43076ee3ce
commit 5a3b6d82b6
4 changed files with 24 additions and 5 deletions

View File

@@ -149,6 +149,18 @@ VERY_NESTED_SCHEMA = {
{"cpc": 6.6666},
None,
),
(
{"type": "object", "properties": {"value": {"type": "array", "items": {"type": "string"}}}},
{"value": {"key": "value"}},
{"value": {"key": "value"}},
"{'key': 'value'} is not of type 'array'",
),
(
{"type": "object", "properties": {"value1": {"type": "object", "properties": {"value2": {"type": "string"}}}}},
{"value1": "value2"},
{"value1": "value2"},
"'value2' is not of type 'object'",
),
],
)
def test_transform(schema, actual, expected, expected_warns, caplog):