def testEventMatching(self): events = fetcher.getWikiFightByName() for event in events: eventname = event.name.encode('utf-8') fetchedEvent = fetcher.getEventPageFromName(eventname)[0].encode('utf-8') ratio = fetcher.compareStringSimilarity(eventname, fetchedEvent) if(ratio< 0.9): print eventname+" |\t | "+fetchedEvent+'|\t ratio:'+str(ratio)
def testCompareString(self): ratio = fetcher.compareStringSimilarity('hello','hello') self.assertEqual(1,ratio)