Lately, I worked on Django DBBackup, I was remaking the database command system: classes allowing launching of backup or restore commands through subprocess.Popen. There was no unit tests and major part of them are based on command line but contrary to what I though mock out Popen took me a some time.