A dummy is an object that does nothing. It just serves the purpose of being passed around as an argument and not making the code crash because we lack an object. But its implementation is totally empty; it does nothing.
In our chat application, we need a connection object to be able to send messages from one client to the other. We have not yet implemented that connection object, and for now, we are focused on having the ChatClient.send_message test pass, but how can we make it pass if we don't yet have a working Connection object the client relies on?
That's where dummy objects come in handy. They replace other objects, faking that they can do their job, but in reality, they do absolutely nothing.
A dummy object for our Connection class would currently look like this:
class _DummyConnection:
def broadcast(*args, **kwargs):
pass
In practice, it's an object that provides a broadcast method but does absolutely nothing. Dummy objects are just...