def test_serialization_roundtrip(merged_config):
    """Test that serializing and then deserializing the config does not lose
    data."""
    config = R2RConfig(merged_config)
    serialized = config.to_toml()

    # Load the serialized config back
    roundtrip_config = R2RConfig(toml.loads(serialized))

    # Compare a couple of key values after roundtrip.
    assert (roundtrip_config.database.graph_creation_settings.
            graph_entity_description_prompt == config.database.
            graph_creation_settings.graph_entity_description_prompt)
    assert (roundtrip_config.orchestration.provider ==
            config.orchestration.provider)
Test that serializing and then deserializing the config does not lose
    data.
py/tests/unit/app/test_config.py