def test_send_war_nag_participants_completed_returns_false_because_url_invalid(tmpdir):

    config_file = tmpdir.mkdir('test_send_war_nag_threshold_not_met_returns_true').join('testfile')
    config_file.write(__config_file__)
    config = load_config_file(config_file.realpath())

    fake_current_war = pybrawl.WarCurrent(
        state               = 'collectionDay',
        collection_end_time = datetime.utcnow().strftime("%Y%m%dT%H%M%S.xxxx"),
        participants        = [
            pybrawl.WarParticipant(
                name              = 'AAA',
                tag               = '#AAA',
                battles_played    = 1,
                number_of_battles = 3
            ),
            pybrawl.WarParticipant(
                name              = 'BBB',
                tag               = '#BBB',
                battles_played    = 1,
                number_of_battles = 3
            )
        ]
    )

    fake_members = [pybrawl.WarParticipant(tag='#AAA')]

    assert discord.send_war_nag(config, fake_current_war, fake_members) == False
def test_send_war_nag_war_no_members_returns_true(tmpdir):
    config_file = tmpdir.mkdir('test_send_war_nag_war_no_members_returns_true').join('testfile')
    config_file.write(__config_file__)
    config = load_config_file(config_file.realpath())

    fake_current_war = pybrawl.WarCurrent(
        state        = 'warDay',
        war_end_time = datetime.utcnow().strftime("%Y%m%dT%H%M%S.xxxx"),
        participants = []
    )

    assert discord.send_war_nag(config, fake_current_war, []) == True
def test_send_war_nag_not_in_war_returns_false(tmpdir):
    config_file = tmpdir.mkdir('test_send_war_nag_not_in_war_returns_false').join('testfile')
    config_file.write(__config_file__)
    config = load_config_file(config_file.realpath())

    assert discord.send_war_nag(config, pybrawl.WarCurrent(state = 'notInWar'), None) == True