Skip to content

Commit

Permalink
why does this not work here but elsewhere?
Browse files Browse the repository at this point in the history
  • Loading branch information
StegSchreck committed Apr 30, 2017
1 parent 9722ed2 commit 76f1ae5
Showing 1 changed file with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from unittest import TestCase
from unittest.mock import patch

from core.factories.match_related_core_factories import MatchFactory, MatchStadiumStatisticsFactory
from core.factories.matchday_related_core_factories import MatchdayFactory
from core.managers.parser_manager import ParserManager


Expand All @@ -26,17 +24,6 @@ def test_parse_matchday(self, parse_matchday_mock):

assert parse_matchday_mock.called

@patch('core.managers.parser_manager.ParserManager.parse_matchday')
@patch('core.parsers.players_parser.PlayersParser.parse')
def test_parse_players(self, parse_players_mock, parse_matchday_mock):
self.parser_manager.parsed_matchday = MatchdayFactory.create()
with patch('core.managers.site_manager.SiteManager') as site_manager_mock:
site_manager_mock.browser.page_source.return_value = "<html></html>"
self.parser_manager.parse_players(site_manager_mock)

assert not parse_matchday_mock.called
assert parse_players_mock.called

@patch('core.managers.parser_manager.ParserManager.parse_matchday')
@patch('core.parsers.players_parser.PlayersParser.parse')
def test_parse_players_and_matchday(self, parse_players_mock, parse_matchday_mock):
Expand Down Expand Up @@ -68,17 +55,6 @@ def test_parse_player_statistics_and_matchday(self, parse_player_statistics_mock
assert parse_players_mock.called
assert parse_player_statistics_mock.called

@patch('core.managers.parser_manager.ParserManager.parse_matchday')
@patch('core.parsers.awp_boundaries_parser.AwpBoundariesParser.parse')
def test_parse_awp(self, parse_awp_mock, parse_matchday_mock):
self.parser_manager.parsed_matchday = MatchdayFactory.create()
with patch('core.managers.site_manager.SiteManager') as site_manager_mock:
site_manager_mock.browser.page_source.return_value = "<html></html>"
self.parser_manager.parse_awp_boundaries(site_manager_mock)

assert not parse_matchday_mock.called
assert parse_awp_mock.called

@patch('core.managers.parser_manager.ParserManager.parse_matchday')
@patch('core.parsers.awp_boundaries_parser.AwpBoundariesParser.parse')
def test_parse_awp_and_matchday(self, parse_awp_mock, parse_matchday_mock):
Expand All @@ -89,17 +65,6 @@ def test_parse_awp_and_matchday(self, parse_awp_mock, parse_matchday_mock):
assert parse_matchday_mock.called
assert parse_awp_mock.called

@patch('core.managers.parser_manager.ParserManager.parse_matchday')
@patch('core.parsers.finances_parser.FinancesParser.parse')
def test_parse_finances(self, parse_finances_mock, parse_matchday_mock):
self.parser_manager.parsed_matchday = MatchdayFactory.create()
with patch('core.managers.site_manager.SiteManager') as site_manager_mock:
site_manager_mock.browser.page_source.return_value = "<html></html>"
self.parser_manager.parse_finances(site_manager_mock)

assert not parse_matchday_mock.called
assert parse_finances_mock.called

@patch('core.managers.parser_manager.ParserManager.parse_matchday')
@patch('core.parsers.finances_parser.FinancesParser.parse')
def test_parse_finances_and_matchday(self, parse_finances_mock, parse_matchday_mock):
Expand All @@ -109,15 +74,3 @@ def test_parse_finances_and_matchday(self, parse_finances_mock, parse_matchday_m

assert parse_matchday_mock.called
assert parse_finances_mock.called

@patch('core.parsers.stadium_stand_statistics_parser.StadiumStandStatisticsParser.parse')
@patch('core.parsers.stadium_statistics_parser.StadiumStatisticsParser.parse')
def test_parse_stadium_statistics(self, parse_stadium_mock, parse_stand_mock):
match = MatchFactory.create()
MatchStadiumStatisticsFactory.create(match=match)
with patch('core.managers.site_manager.SiteManager') as site_manager_mock:
site_manager_mock.browser.page_source.return_value = "<html></html>"
self.parser_manager.parse_stadium_statistics(site_manager_mock, match)

assert parse_stadium_mock.called
assert parse_stand_mock.called

0 comments on commit 76f1ae5

Please sign in to comment.