def test_main_works(self): command.make_app().AndReturn(self.app) command.ConfigDAO.get('test', 'var').AndReturn(None) self.mox.ReplayAll() command.main(['test', 'get', 'test.var'])
def test_main_catches(self): command.show_help(['test']).AndRaise(RuntimeError('catch me')) command.die('Failed: %s', mox.IsA(RuntimeError)) self.mox.ReplayAll() command.main(['test'])