def test_set_parameter_change_type_2():
    parm = ParamFile('tests/test_parameters.json')
    new_value = {
        "reference": {
            "keyVault": {
                "id":
                "/subscriptions/<subscription-id>/resourceGroups/examplegroup/providers/Microsoft.KeyVault/vaults/<vault-name>"
            },
            "secretName": "examplesecret"
        }
    }
    parm.set_parameter('adminPassword', new_value)
    assert parm.get_parameter('adminPassword') == new_value
def test_set_parameter_change_type():
    parm = ParamFile('tests/test_parameters.json')
    new_value = 'test123'
    parm.set_parameter('adminPassword', new_value)
    assert parm.get_parameter('adminPassword') == new_value
def test_set_parameter_invalid_key():
    with pytest.raises(KeyError):
        parm = ParamFile('tests/test_parameters.json')
        parm.set_parameter('badParamName', 'test123')
def test_set_parameter_invalid_key_type():
    with pytest.raises(ValueError):
        parm = ParamFile('tests/test_parameters.json')
        parm.set_parameter(None, 'test123')
def test_set_parameter_base_case():
    parm = ParamFile('tests/test_parameters.json')
    new_value = 'test123'
    parm.set_parameter('storageAccountType', new_value)
    assert parm.get_parameter('storageAccountType') == new_value