def testRun(): db = DouBan() try: db.login('cookie_test') db.run() except Exception, e: print repr(e) print 'run failure' sys.exit(1)
def testPersistent(): db = DouBan() try: db.login('cookie_test') db.run() db.persistent() except KeyboardInterrupt: db.persistent() except Exception, e: db.persistent() print repr(e) sys.exit(1)