code: def test_read_tfrecord_beam():
      builder = DummyBeamDataset()
      with mock.patch.object(
          beam.io, "ReadFromTFRecord"
      ) as mock_read, mock.patch.object(epath, "Path") as mock_epath:
          file_pattern = "/a/b/*"
          mock_epath.return_value.expanduser.return_value = file_pattern
          mock_epath.return_value.glob.return_value = [
              "/a/b/c",
              "/a/b/d",
          ]
          builder.read_tfrecord_beam(file_pattern, validate=True)
          mock_epath.return_value.glob.assert_called_once_with("a/b/*")
          mock_read.assert_called_once_with(
              file_pattern=file_pattern, validate=True
          )
          info_proto = builder.info.as_proto
          assert len(info_proto.data_source_accesses) == 2
          assert (
              info_proto.data_source_accesses[0].file_system.path
              == "/a/b/c"
          )
          assert (
              info_proto.data_source_accesses[1].file_system.path
              == "/a/b/d"
          )
  
imports: import pathlib
  from typing import Callable
  from unittest import mock
  import apache_beam
  from etils import epath
  import numpy
  import pytest
  import tensorflow
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import dataset_utils
  from tensorflow_datasets.core import download
  from tensorflow_datasets.core import features
  from tensorflow_datasets.core import utils
label_desc: Use image node_id 8 for calling a global function with example usage: test_read_tfrecord_beam() without return types