def METHOD_NAME(legacy_profile_reader, parser_data, defaults):
    parser = configparser.ConfigParser()
    parser.read_dict(parser_data)
    output = legacy_profile_reader.prepareLocals(parser, "profile", defaults)
    assert set(defaults.keys()) <= set(output.keys()) # All defaults must be in there.
    assert set(parser_data["profile"]) <= set(output.keys()) # All overwritten values must be in there.
    for key in output:
        if key in parser_data["profile"]:
            assert output[key] == parser_data["profile"][key] # If overwritten, must be the overwritten value.
        else:
            assert output[key] == defaults[key] # Otherwise must be equal to the default.