# Path: eldonationtracker/api/team.py
# class Team(DonorDriveTeam):
#     def __init__(self, team_id: str, output_folder: str, currency_symbol: str, donors_to_display: str,
#                  base_api_url: str):
#     def write_text_files(self, dictionary: dict) -> None:  # pragma: no cover
#     def team_run(self) -> None:
#     def team_api_info(self) -> None:
#     def participant_run(self) -> None:  # pragma: no cover
#     def donation_run(self) -> None:  # pragma: no cover


from unittest import mock
from eldonationtracker.api import team as team
import donordrivepython.api.comms
fake_donation_run = mock.Mock()
fake_badge_run = mock.Mock()


@mock.patch.object(team.Team, "_get_team_json", fake_get_team_json)
@mock.patch.object(team.Team, "participant_run", fake_participant_run)
@mock.patch.object(team.Team, "write_text_files", fake_write_text_files)
@mock.patch.object(team.Team, "donation_run", fake_donation_run)
@mock.patch.object(team.Team, "_update_badges", fake_badge_run)
def test_team_run():
    my_team = team.Team("12345", "folder", "$", "5", "https://www.extra-life.org/api")
    my_team.team_run()
    assert fake_participant_run.call_count == 1
    my_team.team_run()
    assert fake_participant_run.call_count == 1
    fake_get_team_json.return_value = 400, "Captain", 402, 4, "//assets.donordrive.com/…avatar-team-default.gif"
    my_team.team_run()
    assert fake_participant_run.call_count == 2


fake_get_team_json2 = mock.Mock()
fake_get_team_json2.return_value = 400, "Captain", 401, 3, "//assets.donordrive.com/…avatar-team-default.gif"
fake_output_badge_data = mock.Mock()


@mock.patch.object(team.Team, "_get_team_json", fake_get_team_json2)
@mock.patch.object(team.Team, "participant_run", fake_participant_run)
@mock.patch.object(team.Team, "write_text_files", fake_write_text_files)
@mock.patch.object(team.Team, "donation_run", fake_donation_run)
@mock.patch.object(team.Team, "_update_badges", fake_badge_run)

# Path: eldonationtracker/api/team.py
# class Team(DonorDriveTeam):
#     def __init__(self, team_id: str, output_folder: str, currency_symbol: str, donors_to_display: str,
#                  base_api_url: str):
#     def write_text_files(self, dictionary: dict) -> None:  # pragma: no cover
#     def team_run(self) -> None:
#     def team_api_info(self) -> None:
#     def participant_run(self) -> None:  # pragma: no cover
#     def donation_run(self) -> None:  # pragma: no cover


# Path: eldonationtracker/tests/test_team.py
from unittest import mock
from eldonationtracker.api import team as team
import donordrivepython.api.comms

fake_donation_run = mock.Mock()
fake_badge_run = mock.Mock()


@mock.patch.object(team.Team, "_get_team_json", fake_get_team_json)
@mock.patch.object(team.Team, "participant_run", fake_participant_run)
@mock.patch.object(team.Team, "write_text_files", fake_write_text_files)
@mock.patch.object(team.Team, "donation_run", fake_donation_run)
@mock.patch.object(team.Team, "_update_badges", fake_badge_run)
def test_team_run():
    my_team = team.Team("12345", "folder", "$", "5", "https://www.extra-life.org/api")
    my_team.team_run()
    assert fake_participant_run.call_count == 1
    my_team.team_run()
    assert fake_participant_run.call_count == 1
    fake_get_team_json.return_value = 400, "Captain", 402, 4, "//assets.donordrive.com/…avatar-team-default.gif"
    my_team.team_run()
    assert fake_participant_run.call_count == 2


fake_get_team_json2 = mock.Mock()
fake_get_team_json2.return_value = 400, "Captain", 401, 3, "//assets.donordrive.com/…avatar-team-default.gif"
fake_output_badge_data = mock.Mock()


@mock.patch.object(team.Team, "_get_team_json", fake_get_team_json2)
@mock.patch.object(team.Team, "participant_run", fake_participant_run)
@mock.patch.object(team.Team, "write_text_files", fake_write_text_files)
@mock.patch.object(team.Team, "donation_run", fake_donation_run)
@mock.patch.object(team.Team, "_update_badges", fake_badge_run)

@mock.patch.object(team.extralife_io, "output_badge_data", fake_output_badge_data)