def testRun(): db = DouBan() try: db.login('cookie_test') db.run() except Exception, e: print repr(e) print 'run failure' sys.exit(1)
def testLogin(): db = DouBan() cookie_file = '/home/mew7wo/python/douban/cookie_test' try: db.login('./f**k') except Exception, e: print repr(e) print 'login 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)