def METHOD_NAME(
    simple1_nwb_metadata: dict[str, Any], simple1_nwb: Path, format: str
) -> None:
    runner = CliRunner()
    r = runner.invoke(ls, ["-f", format, str(simple1_nwb)])
    assert r.exit_code == 0, f"Exited abnormally. out={r.stdout}"
    # we would need to redirect pyout for its analysis
    out = r.stdout
    if format == "json_lines":
        def load(s: str) -> Any:
            return json.loads(s)
    elif format.startswith("json"):
        def load(s: str) -> Any:
            obj = json.loads(s)
            assert len(obj) == 1  # will be a list with a single elem
            return obj[0]
    elif format == "yaml":
        def load(s: str) -> Any:
            obj = yaml_load(s, typ="base")
            assert len(obj) == 1  # will be a list with a single elem
            return obj[0]
    else:
        return
    metadata = load(out)
    assert metadata
    # check a few fields
    assert metadata.pop("nwb_version").startswith("2.")
    for f in ["session_id", "experiment_description"]:
        assert metadata[f] == simple1_nwb_metadata[f]