Code and machines

Unit testing Cmd module derived classes

Posted in Code and machines, Python on February 19th, 2012 by admin – Be the first to comment

I’ll update this once I’ve figured it out.

I’m writing a customised command-line task manager in Python using the Cmd module. I’ve decided, for practice, to use nice test-driven development so I’ve kicked it off with a very simple Cmd-derived class and a corresponding test class. I’ve added a few very simple methods kicked off by the cmdloop() method but of course in my test class I’d like to create an instance of my cmd-derived class , invoke the cmdloop() and send it some input.

How do I send my object some input from my test method?

More of Darwin

Posted in Arts and Culture, Code and machines, World and Travel on January 16th, 2011 by admin – Be the first to comment

I thought it about time I started using the Facebook page I’d setup for The Beagle Voyage some time ago. I I created a Facebook Application which uses oAuth to post the same content as the Tweets at  @cdarwin to Facebook as status updates. Why not go there and Like the page. In time I daresay I’ll be able to post more content than I do on Twitter.