예제 #1
0
    def ipcompileTest(self):

        #channel.channelkeywordall()
        error = 0
        for n in range(len(channel.channelkeywordall())):
            urlvluecompile = url.url_keyword(china_decode.chinese_decode(str(channel.channelkeywordall()[n])))
            urlvlue = url.url_keyword(china_decode.chinese_decode(str(keyword)))
            if result_compare.compare_result_all(urlvlue,urlvluecompile) == 1:
                print channel.channelkeywordall()[n],"对比结果一致,成功"
            if result_compare.compare_result_all(urlvlue,urlvluecompile) == 0:
                error = error+1
                print channel.channelkeywordall()[n],"对比结果不一致,失败"
        assert error == 0
예제 #2
0
 def travelgroup_Test(self):
     typevlue = self.travelgroup.type()
     error = 0
     for n in range(len(self.travelgroup.keyword())):
         keyword = self.travelgroup.keyword()[n]
         urlvlue = url.url_keyword(china_decode.chinese_decode(str(self.travelgroup.keyword()[n])))
         tpyevluecompile = http.get_key_vlue(urlvlue, http.vluecount(urlvlue, "word", keyword), "type")
         if tpyevluecompile == typevlue:
             print self.travelgroup.keyword()[n], "类型正确为", tpyevluecompile
         else:
             error = error + 1
             print self.travelgroup.keyword()[n], "类型错误为", tpyevluecompile
     assert error == 0