Closed jsouter closed 3 weeks ago
Would have to call attach_mock after each child device is connected as that is when the signal backend gets set to MockSignalBackend and the _backend.put_mock can be accessed. Tom has said he may touch how that is handled soon so I will wait for that to be done first.
I've rebased on top of https://github.com/bluesky/ophyd-async/pull/594, still a WIP but it appears to work with the existing tests. I will work on porting over the new tests I added in the force-pushed-over commits here
Shall I merge?
Shall I merge?
I'm happy with it unless @DominicOram has any more thoughts
Addresses https://github.com/bluesky/ophyd-async/issues/336
Allows a Device to accept a unittest.Mock or a boolean. If True passed, creates a new Mock() if Mock() passed, finds any child mocks set with attach_mock if they exist, else passes down mock=True to children.
Will push some tests for this
edit: now realising that I misunderstood the requirements, will fix quickly!