def test_convert_params():
    """Test conversion of params to a dict."""
    # Test normal dict, make sure it is unchanged
    params = {"string": "string", "int": 1, "float": 0.1, "bool": True, "none": None}
    expected = params.copy()
    assert _convert_params(params) == expected

    # Test None conversion
    assert _convert_params(None) == {}

    # Test conversion of argparse Namespace
    params = Namespace(string="string", int=1, float=0.1, bool=True, none=None)
    expected = vars(params)
    assert _convert_params(params) == expected
Test conversion of params to a dict.
tests/tests_fabric/utilities/test_logger.py