예제 #1
0
파일: test22.py 프로젝트: Steffb/betscraper
    def testGetWikiEvents(self):
        events = fetcher.getWikiFightByName()

        self.assertEqual('UFC on Fox: Johnson vs. Bader',fetcher.findEventByName('UFC on Fox: Johnson vs. Bader', events).name)

        self.assertEqual('/wiki/UFC_on_Fox:_Johnson_vs._Bader', events[0].site)
        self.assertEqual(datetime.date(2016,1,30), events[0].date)
        self.assertEqual('UFC on Fox: Johnson vs. Bader', events[0].name)
예제 #2
0
파일: test22.py 프로젝트: Steffb/betscraper
    def testUnicode(self):
        events = fetcher.getWikiFightByName()


        for e in events:

            if('illa'.decode() in e.name ):
                print e.name
예제 #3
0
파일: test22.py 프로젝트: Steffb/betscraper
    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)
예제 #4
0
파일: test22.py 프로젝트: Steffb/betscraper
    def testCreateEvent(self):

        events = fetcher.getWikiFightByName()
        event =  events[0]
        wlobjs = fetcher.getWikiFightResults(event.site)
        #url = fetcher.getEventPageFromName(event.name)
        data =fetcher.getEventDataByName(event.name)
        result = fetcher.joinResultAndLines(data,wlobjs)

        self.assertEqual('Stephen Thompson',result[0].fightWinnerWinner)
        self.assertEqual(1.34,result[0].fighterOneLine)
        self.assertEqual(3.45,result[0].fighterTwoLine)