code: def test_pulsar_simple_messages():
      """Test consuming simple messages from a Pulsar topic with PulsarIODataset.
  
      NOTE: After the pulsar standalone is setup during the testing phase, 6 messages
      (D0, D1, ..., D5) are sent to the `test` topic.
      """
  
      dataset = tfio.experimental.streaming.PulsarIODataset(
          service_url="pulsar://localhost:6650",
          topic="test",
          subscription="subscription-0",
          timeout=default_pulsar_timeout,
      )
      assert np.all(
          [k.numpy() for (k, _) in dataset]
          == [("D" + str(i)).encode() for i in range(6)]
      )
  
file_path: io/tests/test_pulsar.py
imports: import sys
  import numpy
  import tensorflow
  import tensorflow_io
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_pulsar_simple_messages() without return types