We use a lot of SSH-enabled switches and routers at work and it can be tough to create really good unit tests when the code relies on external devices, all with their own state, quirks and bugs. To get around this I created a little micro library called SSHim ( https://github.com/simon-engledew/sshim ) built on Paramiko which lets you stub out SSH servers. We use this to emulate a whole range of box interactions within unit tests.Hopefully this will be useful for someone else out there!