from src.dsg_core.utils.mappings import deep_update


def test_deep_update():
    dict1 = {
        "properties": {
            "name": {
                "type": "string",
                "minLength": 1,
            }
        },
        "required": ["name"],
    }

    dict2 = {
        "properties": {
            "name": {
                "maxLength": 255,
                "minLength": 3,
            }
        },
    }
    result = deep_update(dict1, dict2)
    print(result)
    assert result == {
        "properties": {
            "name": {
                "type": "string",
                "maxLength": 255,
                "minLength": 3,
            }
        },
        "required": ["name"],
    }
