title: Unit testing pythons telnetlib
body: <p>I'm writing a simple program that talks to a router via telnet and issues some simple commands to it. I want to be able to test these commands, that the program responds correctly to the servers output and sends the commands at the right moments. However i can't figure out a good way to do it. 
  Best I've come up with is to create a small telnet server for my unit tests but that seems a bit excessive and i'm hoping there's a simpler way to do it.</p>
  
  <p>Anyone got any ideas?</p>