Esempio n. 1
0
def testRun():
    db = DouBan()
    try:
        db.login('cookie_test')
        db.run()
    except Exception, e:
        print repr(e)
        print 'run failure'
        sys.exit(1)
Esempio n. 2
0
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) 
Esempio n. 3
0
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)