code: def test_json_codec(input_: Any, expected_result: Any):
      cm = (
          pytest.raises(type(expected_result))
          if isinstance(expected_result, Exception)
          else nullcontext()
      )
      with cm:
          codec = JsonKeyValueCodec()
          encoded_value = codec.encode(input_)
          assert expected_result == codec.decode(encoded_value)
  
file_path: superset/tests/unit_tests/key_value/codec_test.py
imports: from contextlib import nullcontext
  from typing import Any
  import pytest
  from marshmallow import Schema
  from superset.dashboards.permalink.schemas import DashboardPermalinkSchema
  from superset.key_value.exceptions import KeyValueCodecEncodeException
  from superset.key_value.types import JsonKeyValueCodec, MarshmallowKeyValueCodec, PickleKeyValueCodec
label_desc: Use image node_id 1 for calling a global function with example usage: test_json_codec(input_, expected_result) without return types