code: def test_pubsub_topic():
      pubsub = Pubsub(EventService())
      subscriber = DummySubscriber()
  
      publisher = pubsub.create_event_topic(DummyInterface)
  
      pubsub.register_subscriber(subscriber)
  
      publisher.event1()
      publisher.event2(param1=1, param2=2)
  
      assert len(subscriber.events) == 2
  
      record = subscriber.events[0]
      assert record.interface_method == DummyInterface.event1
      assert record.attributes == dict()
  
      record = subscriber.events[1]
      assert record.interface_method == DummyInterface.event2
      assert record.attributes == dict(param1=1, param2=2)
  
file_path: maze/maze/test/core/test_pubsub.py
imports: from abc import ABC
  from typing import List, Type
  import pytest
  from maze.core.events.event_service import EventService
  from maze.core.events.event_record import EventRecord
  from maze.core.events.pubsub import Pubsub, Subscriber
label_desc: Use image node_id 1 for calling a global function with example usage: test_pubsub_topic() without return types