code: def test_load_experiment_config(tmpdir):
      valid = {"key": ["a", "b"], "random": [True, False]}
      valid_path = tmpdir.join("valid.json")
  
      with open(valid_path, "w") as f:
          json.dump(valid, f)
  
      invalid_path = tmpdir.join("invalid.json")
  
      with open(invalid_path, "w") as f:
          f.write("{{{I am not JSON!\n")
  
      # Failing the schema with invalid json raises an ARGPARSE error, not a schema
      # error. We haven't converted experimentconfig to schema yet.
      #
      # We use schema to validate, but the ua.argparse_schema wrapper converts the
      # error internally.
      with pytest.raises(ArgumentTypeError):
          c.load_experiment_config(invalid_path)
  
      # A valid config should round trip.
      assert c.load_experiment_config(valid_path) == valid
  
file_path: caliban/tests/caliban/config/test_experiment.py
imports: import json
  from argparse import ArgumentTypeError
  import caliban.config.experiment
  import caliban.util
  import caliban.util.schema
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_load_experiment_config(tmpdir) without return types