Esempio n. 1
0
 def testPatternsCount(self):
     patterns = []
     patterns.append({'subject':'amazon','relation':'course_of_action_of_goal','object':'cloud'})
     data = {'action' : 'extract_patterns','discussion_id': 10, 'patterns':patterns}
     json = simplejson.dumps(data)
     result = handle_message(json)
     logging.info("testPatternsCount result %s"% result)
     self.failUnlessEqual(2,len(result))
Esempio n. 2
0
    def setUp(self):
        patterns = []
        patterns.append({'subject':'amazon','relation':'course_of_action_of_goal','object':'cloud'})
        patterns.append({'subject':'amazon','relation':'course_of_action_of_goal','object':'cloud'})
        patterns.append({'subject':'google','relation':'course_of_action_of_possible_result','object':'high_performence'})
        patterns.append({'subject':'webfaction','relation':'course_of_action_of_sibling','object':'amazon'})
        data = {'action' : 'extract_patterns','discussion_id': 10, 'patterns':patterns}


        json = simplejson.dumps(data)
        result = handle_message(json)
        logging.info("result %s" % result)