make_mock_write_topics#

lsst.ts.salobj.make_mock_write_topics(name, attr_names, index=None)#

Make a struct of mock write topics for unit testing data clients.

The struct attribute names are the topic attr_names, and the values are instances of topics.MockWriteTopic.

Parameters:
  • name (str) – SAL component name.

  • attr_names (list [str]) – List of topic attribute names, e.g. [“tel_temperature”, “evt_lightningStrike”]

  • index (int | None, optional) – The SAL index. Irrelevant unless you want to check the salIndex field of the data. None results in 0 for a non-indexed compoonent and 1 for an indexed component.

Return type:

AsyncGenerator[SimpleNamespace, None]