def testConfig(self): result=getresult("http://www.ali213.net/news/html/2015-6/162867.html") print "-----------------------------------------------------------------------------" print result result=getresult("http://www.ali213.net/news/html/2015-6/160667.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("支线任务不再浪费时间"),-1) self.assertGreater(result.article_properties["summary"].find("根据Xbox官方杂志最新报道"),-1) self.assertGreater(result.article_properties["source"].find("互联网"),-1) self.assertEqual(result.article_properties["issuedate"],"2015-06-08 17:41:06") self.assertGreater(result.content.find("一触即燃"),-1) #self.assertGreater(result.article_properties["author"].find("费希"),-1) pass result=getresult("http://www.ali213.net/news/html/2015-6/160503.html") result=FunctionHelper.string2object(result) print self.assertGreater(result.article_properties["title"].find("河南大学生拍"),-1) print self.assertGreater(result.article_properties["summary"].find("的一群毕业生玩起"),-1) #self.assertGreater(result.article_properties["source"].find("互联网"),-1) print self.assertEqual(result.article_properties["issuedate"],"2015-06-07 17:22:49") print self.assertGreater(result.content.find("http://img2.ali213.net/picfile/News/2015/06/07/584_2015060752059634.jpg"),-1) pass
def testConfig(self): result=getresult("http://3g.ali213.net/gl/m/169769.html?d=2015-06-02&t=new&n=??-%C3%A8??%C3%A8??%C3%A9??3D") result=FunctionHelper.string2object(result) print result pass name=u"命运之神".encode('utf8') result=getresult("http://3g.ali213.net/gl/m/48312.html?d=2014-09-09&t=new&n="+name) result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("《命运之神》副本怎么玩"),-1) self.assertGreater(result.article_properties["summary"].find("啥名次也木有、各种蛋疼"),-1) self.assertGreater(result.article_properties["source"].find("命运之神"),-1) self.assertEqual(result.article_properties["issuedate"],"2014-09-09") self.assertGreater(result.content.find("浪费那么多体力去换那点经验级"),-1) pass name=u"绝地战警".encode('utf8') result=getresult("http://3g.ali213.net/gl/m/114223.html?d=2014-09-11&t=hot&n="+name) result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("绝地战警修改攻略"),-1) self.assertGreater(result.article_properties["summary"].find("玩家只要仔细看完攻略"),-1) self.assertGreater(result.article_properties["source"].find("绝地战警"),-1) self.assertEqual(result.article_properties["issuedate"],"2014-09-11") self.assertGreater(result.content.find("花一点钱或者进入一点钱就能正常显示了"),-1) pass
def testConfig(self): result=getresult("http://m.ali213.net/android/102317.html") result=FunctionHelper.string2object(result) pass result=getresult("http://m.ali213.net/ios/23881.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("混沌与秩序之英雄战歌"),-1) self.assertGreater(result.article_properties["summary"].find("亲测可用啊"),-1) #self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2015-04-28") self.assertGreater(result.content.find("混沌与秩序之英雄战歌截图"),-1) pass result=getresult("http://m.ali213.net/wp/81752.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("脑波攻击"),-1) self.assertGreater(result.article_properties["summary"].find("乐高的忠实fans应该会很开心"),-1) self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2013-10-10") self.assertGreater(result.content.find("脑波攻击游戏截图"),-1) pass result=getresult("http://m.ali213.net/android/109249.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("邪雨"),-1) self.assertGreater(result.article_properties["summary"].find("有点无厘头"),-1) self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2015-05-18") self.assertGreater(result.content.find("等待提示安装完成后即可到手机里游玩游戏"),-1) pass
def testConfig(self): result=getresult("http://m.ali213.net/news/150617/30275.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("全民爱主公"),-1) self.assertGreater(result.article_properties["summary"].find("是拇指游玩2015年出品的一款全新三国题材手游"),-1) #self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2015-06-17 16:04:30") self.assertGreater(result.content.find("就连人物表情也有十分细致的刻画"),-1) #self.assertGreater(result.article_properties["author"].find("费希"),-1) pass result=getresult("http://m.ali213.net/news/141229/20089.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("团PVP火热来袭"),-1) self.assertGreater(result.article_properties["summary"].find("量模型和特效支持下达到了大片级别"),-1) #self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2014-12-29 10:59:48") self.assertGreater(result.content.find("一定会给玩家制造一个又一个的惊喜"),-1) #self.assertGreater(result.article_properties["author"].find("费希"),-1) pass result=getresult("http://m.ali213.net/news/131203/3779.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("安卓版登场"),-1) self.assertGreater(result.article_properties["summary"].find("安卓平台的玩家倒是可以去体验一番"),-1) #self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2013-12-03 13:21:11") #self.assertGreater(result.content.find("就有点无缘相见的感觉了"),-1) #self.assertGreater(result.article_properties["author"].find("费希"),-1) pass result=getresult("http://m.ali213.net/news/150515/27677.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("全平台攻势《太极熊猫》WP版本即将上线"),-1) self.assertGreater(result.article_properties["summary"].find("近期上线Windows Phone商"),-1) #self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2015-05-15 13:50:52") self.assertGreater(result.content.find("都可以畅享《太极熊猫》带来的乐趣"),-1) #self.assertGreater(result.article_properties["author"].find("费希"),-1) pass result=getresult("http://m.ali213.net/news/150429/26623.html") result=FunctionHelper.string2object(result) self.assertGreater(result.article_properties["title"].find("SC收购WP渠道"),-1) self.assertGreater(result.article_properties["summary"].find("同时借微疯客平台代理中国手游进行全球发行"),-1) #self.assertGreater(result.article_properties["source"].find("ali213"),-1) self.assertEqual(result.article_properties["issuedate"],"2015-04-29 11:24:20") self.assertGreater(result.content.find("部分单品获得200万美元以上的月流水"),-1) #self.assertGreater(result.article_properties["author"].find("费希"),-1) pass