Esempio n. 1
0
 def test_9_4(self):
     "test getResult from recommend.py"
     c2 = []
     dataList = []
     result = getResult(dataList, c2, '')
     expectResult = []
     self.assertListEqual(result, expectResult, "getResult Error")
Esempio n. 2
0
 def test_9_4(self):
     "test getResult from recommend.py"
     c2 = []
     dataList = []
     result = getResult(dataList,c2,'')
     expectResult = []
     self.assertListEqual(result,expectResult,"getResult Error")
Esempio n. 3
0
 def test_9_2(self):
     "test getResult from recommend.py"
     c2 = [[['1'],['2'],['3'],['5']],[['1','3'],['3','2'],['2','5'],['3','5']],[['3','2','5']]]
     dataList = []
     result = getResult(dataList,c2,'')
     expectResult = []
     self.assertListEqual(result,expectResult,"getResult Error")
Esempio n. 4
0
 def test_9_2(self):
     "test getResult from recommend.py"
     c2 = [[['1'], ['2'], ['3'], ['5']],
           [['1', '3'], ['3', '2'], ['2', '5'], ['3', '5']],
           [['3', '2', '5']]]
     dataList = []
     result = getResult(dataList, c2, '')
     expectResult = []
     self.assertListEqual(result, expectResult, "getResult Error")
def api_article(uid):

    predictDictData = recommend.getResult(uid)
    res_dict = {}
    i = 0
    # Extracting corresponding title
    for ap in predictDictData:
        res_dict[i] = [ap, my_dict.get(str(ap))]
        i = i + 1
    RESPONSE_JSON_DATA = json.dumps(res_dict)
    RESPONSE = Response(RESPONSE_JSON_DATA,
                        status=200,
                        mimetype='application/json')
    return RESPONSE