예제 #1
0
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'player_statistics.html'),
                        encoding='utf8')
        self.matchday = MatchdayFactory.create()
        user = OFMUserFactory.create()
        season = SeasonFactory.create()

        country_choices = Country.get_choices()
        country_iso_greece = list(country_choices.keys())[list(
            country_choices.values()).index('Griechenland')]
        nationality_greece, _ = Country.objects.get_or_create(
            country=country_iso_greece)

        self.player = Player.objects.create(id='159883060',
                                            position='TW',
                                            name='Chrístos Tsigas',
                                            birth_season=season,
                                            nationality=nationality_greece)
        self.player = Player.objects.create(id='160195494',
                                            position='LV',
                                            name='Irwin O\'Canny',
                                            birth_season=season,
                                            nationality=nationality_greece)
        self.player = Player.objects.create(id='159341445',
                                            position='LMD',
                                            name='Jan Stemmler',
                                            birth_season=season,
                                            nationality=nationality_greece)

        self.parser = PlayerStatisticsParser(testdata, user, self.matchday)
        self.player_stat_list = self.parser.parse()
        self.first_player_stat = self.player_stat_list[0]
        self.assertEqual(Matchday.objects.all().count(), 1)
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'stadium_environment.html'), encoding='utf8')
        self.user = OFMUserFactory.create(username='******')
        matchday2 = MatchdayFactory.create(number=2)
        self.match2 = MatchFactory.create(user=self.user, matchday=matchday2)

        self.parser = StadiumStatisticsParser(testdata, self.user, self.match2)
예제 #3
0
 def setUp(self):
     testdata = open(os.path.join(TESTDATA_PATH, 'awp_boundaries.html'),
                     encoding='utf8')
     self.matchday = MatchdayFactory.create()
     self.user = OFMUserFactory.create()
     self.parser = AwpBoundariesParser(testdata, self.user, self.matchday)
     self.awp_boundaries = self.parser.parse()
예제 #4
0
 def setUp(self):
     testdata = open(os.path.join(TESTDATA_PATH, 'player.html'), encoding='utf8')
     self.matchday = MatchdayFactory.create(number=2)
     self.user = OFMUserFactory.create()
     self.parser = PlayersParser(testdata, self.user, self.matchday)
     self.player_list = self.parser.parse()
     self.first_player = self.player_list[0]
예제 #5
0
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'home_match.html'), encoding='utf8')
        MatchdayFactory.create(number=1)
        self.user = OFMUserFactory.create()

        parser = MatchDetailsParser(testdata, self.user, True)
        self.match_stat = parser.parse()
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'stadium_overview.html'), encoding='utf8')
        self.user = OFMUserFactory.create(username='******')
        self.match = MatchFactory.create(user=self.user)
        MatchStadiumStatisticsFactory.create(match=self.match)

        self.parser = StadiumStandStatisticsParser(testdata, self.user, self.match)
        self.stadium_stand_stats = self.parser.parse()
예제 #7
0
 def setUp(self):
     testdata = open(os.path.join(TESTDATA_PATH, 'player.html'),
                     encoding='utf8')
     self.matchday = MatchdayFactory.create(number=2)
     self.user = OFMUserFactory.create()
     self.parser = PlayersParser(testdata, self.user, self.matchday)
     self.player_list = self.parser.parse()
     self.first_player = self.player_list[0]
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'future_match_row.html'), encoding='utf8')
        MatchdayFactory.create(number=1)
        self.user = OFMUserFactory.create()

        soup = BeautifulSoup(testdata, "html.parser")

        parser = BasicMatchRowParser(soup, self.user)
        self.match_stat = parser.parse()
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'home_match_row_won_by_default.html'), encoding='utf8')
        MatchdayFactory.create(number=1)
        self.user = OFMUserFactory.create()

        soup = BeautifulSoup(testdata, "html.parser")

        self.parser = BasicMatchRowParser(soup, self.user)
        self.match_stat = self.parser.parse()
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'stadium_overview_special_construction_and_repair.html'),
                        encoding='utf8')
        self.user = OFMUserFactory.create(username='******')
        self.match = MatchFactory.create(user=self.user)
        MatchStadiumStatisticsFactory.create(match=self.match)

        self.parser = StadiumStandStatisticsParser(testdata, self.user, self.match)
        self.stadium_stand_stats = self.parser.parse()
예제 #11
0
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH,
                                     'stadium_environment.html'),
                        encoding='utf8')
        self.user = OFMUserFactory.create(username='******')
        matchday2 = MatchdayFactory.create(number=2)
        self.match2 = MatchFactory.create(user=self.user, matchday=matchday2)

        self.parser = StadiumStatisticsParser(testdata, self.user, self.match2)
예제 #12
0
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'stadium_overview.html'),
                        encoding='utf8')
        self.user = OFMUserFactory.create(username='******')
        self.match = MatchFactory.create(user=self.user)
        MatchStadiumStatisticsFactory.create(match=self.match)

        self.parser = StadiumStandStatisticsParser(testdata, self.user,
                                                   self.match)
        self.stadium_stand_stats = self.parser.parse()
예제 #13
0
    def setUp(self):
        testdata = open(os.path.join(
            TESTDATA_PATH,
            'stadium_overview_special_construction_and_repair.html'),
                        encoding='utf8')
        self.user = OFMUserFactory.create(username='******')
        self.match = MatchFactory.create(user=self.user)
        MatchStadiumStatisticsFactory.create(match=self.match)

        self.parser = StadiumStandStatisticsParser(testdata, self.user,
                                                   self.match)
        self.stadium_stand_stats = self.parser.parse()
    def setUp(self):
        testdata = open(os.path.join(TESTDATA_PATH, 'player_statistics.html'), encoding='utf8')
        self.matchday = MatchdayFactory.create()
        user = OFMUserFactory.create()
        season = SeasonFactory.create()

        country_choices = Country.get_choices()
        country_iso_greece = list(country_choices.keys())[list(country_choices.values()).index('Griechenland')]
        nationality_greece, _ = Country.objects.get_or_create(country=country_iso_greece)

        self.player = Player.objects.create(
            id='159883060',
            position='TW',
            name='Chrístos Tsigas',
            birth_season=season,
            nationality=nationality_greece
        )
        self.player = Player.objects.create(
            id='160195494',
            position='LV',
            name='Irwin O\'Canny',
            birth_season=season,
            nationality=nationality_greece
        )
        self.player = Player.objects.create(
            id='159341445',
            position='LMD',
            name='Jan Stemmler',
            birth_season=season,
            nationality=nationality_greece
        )

        self.parser = PlayerStatisticsParser(testdata, user, self.matchday)
        self.player_stat_list = self.parser.parse()
        self.first_player_stat = self.player_stat_list[0]
        self.assertEqual(Matchday.objects.all().count(), 1)
 def setUp(self):
     testdata = open(os.path.join(TESTDATA_PATH, 'awp_boundaries.html'), encoding='utf8')
     self.matchday = MatchdayFactory.create()
     self.user = OFMUserFactory.create()
     self.parser = AwpBoundariesParser(testdata, self.user, self.matchday)
     self.awp_boundaries = self.parser.parse()