code: def test_validate_metadata(self):
      r = validate_request_type({"entrypoint": "abc"}, JobSubmitRequest)
      assert r.entrypoint == "abc"
      assert r.metadata is None
  
      r = validate_request_type(
          {"entrypoint": "abc", "metadata": {"hi": "hi2"}},
          JobSubmitRequest,
      )
      assert r.entrypoint == "abc"
      assert r.metadata == {"hi": "hi2"}
  
      with pytest.raises(TypeError, match="must be a dict"):
          validate_request_type(
              {"entrypoint": "abc", "metadata": 123}, JobSubmitRequest
          )
  
      with pytest.raises(TypeError, match="keys must be strings"):
          validate_request_type(
              {"entrypoint": "abc", "metadata": {1: "hi"}},
              JobSubmitRequest,
          )
  
      with pytest.raises(TypeError, match="values must be strings"):
          validate_request_type(
              {"entrypoint": "abc", "metadata": {"hi": 1}},
              JobSubmitRequest,
          )
  
file_path: ray/python/ray/dashboard/modules/job/tests/test_common.py
imports: import pytest
  import json
  from ray.dashboard.modules.job.common import JobInfo, JobStatus, http_uri_components_to_uri, uri_to_http_components, validate_request_type, JobSubmitRequest
  from ray.core.generated.gcs_pb2 import JobsAPIInfo
  from google.protobuf.json_format import Parse
label_desc: Use image node_id 4 for calling the TestJobSubmitRequestValidation obj's underlying member method code with example usage: obj.test_validate_metadata() without return types