from Draft import Draft
import io
import random

def test_user_team_and_bot(monkeypatch, capsys):


    monkeypatch.setattr('sys.stdin',
                        io.StringIO("Y\n<NAME>\n<NAME>\n<NAME>-Schuster\n<NAME>\n<NAME>\n<NAME>\nTre Boston\nN"))

    def seed_bots():
        random.seed(4)

    d = Draft()
    seed_bots() #seed so that bot teams are the same
    d.draft_start()




    captured = capsys.readouterr().out
    output = '''Welcome to the Draft!
Would you like to start the Draft? Y/N: \nQB
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
Case Keenum
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the QB's name you would like to draft from above list (Case Sensitive): \nTom Brady was added to your team!

RB
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
De<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the RB's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!

WR
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
De<NAME>
<NAME>
<NAME>
<NAME>
De<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
JuJu Smith-Schuster
<NAME>
<NAME>
<NAME>
<NAME>
DK Metcalf
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
De'<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
J.J. Arcega-Whiteside
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the WR's name you would like to draft from above list (Case Sensitive): \nJuJu Smith-Schuster was added to your team!

TE
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the TE's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!

K
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the K's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!

LB
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the LB's name you would like to draft from above list (Case Sensitive): \nMario Addison was added to your team!

DB
Tre Boston
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>-Coleman
<NAME>
<NAME>
<NAME>-Wilson
<NAME>

Enter the DB's name you would like to draft from above list (Case Sensitive): \nTre Boston was added to your team!
Your team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': 'Ju<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': 'Tre Boston'}

Bot 1 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}

Bot 2 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}

Bot 3 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}

'''
    assert output == captured

def test_draft_exit(monkeypatch, capsys):

    monkeypatch.setattr('sys.stdin', io.StringIO("N\n"))

    d = Draft()
    d.draft_start()

    captured = capsys.readouterr().out
    assert "Welcome to the Draft!\n"
    "Would you like to start the Draft? Y/N: \n" == captured

from Draft import Draft
import io
import random

def test_user_team_and_bot(monkeypatch, capsys):


    monkeypatch.setattr('sys.stdin',
                        io.StringIO("Y\n<NAME>\n<NAME>\n<NAME>-Schuster\n<NAME>\n<NAME>\n<NAME>\nTre Boston\nN"))

    def seed_bots():
        random.seed(4)

    d = Draft()
    seed_bots() #seed so that bot teams are the same
    d.draft_start()




    captured = capsys.readouterr().out
    output = '''Welcome to the Draft!
Would you like to start the Draft? Y/N: \nQB
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
Case Keenum
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the QB's name you would like to draft from above list (Case Sensitive): \nTom Brady was added to your team!

RB
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
De<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the RB's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!

WR
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
De<NAME>
<NAME>
<NAME>
<NAME>
De<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
JuJu Smith-Schuster
<NAME>
<NAME>
<NAME>
<NAME>
DK Metcalf
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
De'<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
J.J. Arcega-Whiteside
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the WR's name you would like to draft from above list (Case Sensitive): \nJuJu Smith-Schuster was added to your team!

TE
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the TE's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!

K
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the K's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!

LB
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>

Enter the LB's name you would like to draft from above list (Case Sensitive): \nMario Addison was added to your team!

DB
Tre Boston
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>
<NAME>-Coleman
<NAME>
<NAME>
<NAME>-Wilson
<NAME>

Enter the DB's name you would like to draft from above list (Case Sensitive): \nTre Boston was added to your team!
Your team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': 'Ju<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': 'Tre Boston'}

Bot 1 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}

Bot 2 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}

Bot 3 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}

'''
    assert output == captured

def test_draft_exit(monkeypatch, capsys):

    monkeypatch.setattr('sys.stdin', io.StringIO("N\n"))

    d = Draft()
    d.draft_start()

    captured = capsys.readouterr().out
    assert "Welcome to the Draft!\n"
    "Would you like to start the Draft? Y/N: \n" == captured

#seed so that bot teams are the same Welcome to the Draft! Would you like to start the Draft? Y/N: \nQB <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> Case Keenum <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>  Enter the QB's name you would like to draft from above list (Case Sensitive): \nTom Brady was added to your team!  RB <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> De<NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>  Enter the RB's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!  WR <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> De<NAME> <NAME> <NAME> <NAME> De<NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> JuJu Smith-Schuster <NAME> <NAME> <NAME> <NAME> DK Metcalf <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> De'<NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> J.J. Arcega-Whiteside <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>  Enter the WR's name you would like to draft from above list (Case Sensitive): \nJuJu Smith-Schuster was added to your team!  TE <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>  Enter the TE's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!  K <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>  Enter the K's name you would like to draft from above list (Case Sensitive): \n<NAME> was added to your team!  LB <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>  Enter the LB's name you would like to draft from above list (Case Sensitive): \nMario Addison was added to your team!  DB Tre Boston <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME> <NAME>-Coleman <NAME> <NAME> <NAME>-Wilson <NAME>  Enter the DB's name you would like to draft from above list (Case Sensitive): \nTre Boston was added to your team! Your team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': 'Ju<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': 'Tre Boston'}  Bot 1 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}  Bot 2 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}  Bot 3 team consists of: {'QB': '<NAME>', 'RB': '<NAME>', 'WR': '<NAME>', 'TE': '<NAME>', 'K': '<NAME>', 'LB': '<NAME>', 'DB': '<NAME>'}