Exemplo n.º 1
0
def test_config_invalid_yaml_config():
    cfg = PfrConfiguration(device="lpc55s6x")
    cmpa = CMPA("lpc55s6x", user_config=cfg)
    cmpa.parse(bytes(512))
    cmpa.user_config.device = None
    with pytest.raises(SPSDKError, match="Device not found"):
        cmpa.get_yaml_config(exclude_computed=False)
    cfg = PfrConfiguration(device="lpc55s6x")
    cmpa = CMPA("lpc55s6x", user_config=cfg)
    cmpa.parse(bytes(512))
    cmpa.user_config.type = None
    with pytest.raises(SPSDKError, match="Type not found"):
        cmpa.get_yaml_config(exclude_computed=False)
Exemplo n.º 2
0
def test_config_cmpa():
    """Test PFR tool - Test CMPA configuration."""
    cmpa = CMPA("lpc55s6x")
    config = cmpa.generate_config()
    config2 = cmpa.generate_config(exclude_computed=False)

    assert config != config2

    cmpa2 = CMPA("lpc55s6x", user_config=PfrConfiguration(config2))
    cmpa2.parse(bytes(512))
    out = cmpa2.get_yaml_config(exclude_computed=False)

    assert out == config2
Exemplo n.º 3
0
def test_config_cmpa():
    cmpa = CMPA('lpc55s6x')
    config = cmpa.generate_config()
    config2 = cmpa.generate_config(exclude_computed=False)

    assert config != config2

    cmpa2 = CMPA('lpc55s6x', user_config=config2)
    out = cmpa2.parse(bytes(512), exclude_computed=False)

    assert out == config2