def test_load_configuration_file():
    config = ConfigurationLoader()
    base_dir = os.path.dirname(os.path.abspath(__file__))
    config_path = os.path.join(base_dir, 'tmp-configuration.json')
    config.configuration_file_path = config_path

    # There shouldn't be a config file, so it will write one
    config_dict = config.load_configuration_file()
    assert os.path.exists(config_path), "Didn't write a config file!"
    assert config_dict == DEFAULT_CONFIG, "Config returned doesn't match default config"
    with open(config_path, 'r') as f:
        written_config = json.load(f)
    assert written_config == DEFAULT_CONFIG, "Written config doesn't match default config"

    # Now we want to do it all again writing our own config file
    new_config = {
        "window": {
            "width": 813,
            "height": 2450,
            "ticks_per_second": 63,
            "resizeable": False,
            "exclusive_mouse": False,
        },
        "controls": {
            "forward": "Z",
            "backward": "S",
            "right": "D",
            "left": "Q",
            "jump": "LSHIFT",
            "down": "TAB",
            "fly": "SPACE",
        },
        "world": {
            "gravity": 234.0,
            "player_height": 123,
            "max_jump_height": 34.1,
            "terminal_velocity": 431,
            "walking_speed": 12,
            "flying_speed": 34,
        },
    }

    with open(config_path, 'w') as f:
        json.dump(new_config, f, indent=4)
    opened_config = config.load_configuration_file()
    assert opened_config == new_config, "Loaded config doesn't match what we wrote"

    # Clean up after ourselves
    os.remove(config_path)
Return index of the value next to *value* in *values*.
dataset/ETHPy150Open traverseda/pycraft/tests/test_configuration.py/test_load_configuration_file--crossover with--dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/math.py/end_index_of_value_in_range