Ejemplo n.º 1
0
def test_format_footer_text_group_event(group_event):
    # Group events already include the user in the field value.
    assert format_footer_text(group_event) == Embed.Empty
Ejemplo n.º 2
0
def test_format_footer_text_group_event_reason(group_event):
    group_event.type = "remove"
    group_event.content = "Resigned"
    assert format_footer_text(group_event) == "NAT \"Resigned\""
Ejemplo n.º 3
0
def test_format_footer_text_kudosu_given(kudosu_gain_event):
    assert format_footer_text(kudosu_gain_event) == "sometwo"
Ejemplo n.º 4
0
def test_format_footer_text_kudosu_denied(kudosu_gain_event):
    kudosu_gain_event.type = "kudosu-deny"
    kudosu_gain_event.user = None
    assert format_footer_text(kudosu_gain_event) == Embed.Empty
Ejemplo n.º 5
0
def test_format_footer_text_preview(suggestion_event):
    suggestion_event.content = "04:25:218 (3,4) - the guitar is really strong here so mapping to the red beats only feels unfitting"
    assert format_footer_text(
        suggestion_event
    ) == f"{suggestion_event.user} {format_preview(suggestion_event.content)}"
Ejemplo n.º 6
0
def test_format_footer_text_no_comment(suggestion_event):
    suggestion_event.content = ""
    assert format_footer_text(suggestion_event) == "someone"
Ejemplo n.º 7
0
def test_format_footer_text_no_user(qualify_event):
    assert format_footer_text(qualify_event) == Embed.Empty
Ejemplo n.º 8
0
def test_format_footer_text_newspost(newspost_event):
    # Newsposts already include their preview in the post itself, so we skip this.
    assert format_footer_text(newspost_event) == "sometwo"
Ejemplo n.º 9
0
def test_format_footer_text_difficulty_reopen(suggestion_event):
    suggestion_event.type = types.REOPEN
    suggestion_event.discussion.tab = "timeline"
    suggestion_event.discussion.difficulty = "Someone's Expert"
    assert format_footer_text(suggestion_event) == "someone \"hi\""
Ejemplo n.º 10
0
def test_format_footer_text_difficulty(suggestion_event):
    suggestion_event.discussion.tab = "timeline"
    suggestion_event.discussion.difficulty = "Someone's Expert"
    assert format_footer_text(
        suggestion_event) == "someone \"hi\" [Someone's Expert]"
Ejemplo n.º 11
0
def test_format_footer_text(suggestion_event):
    assert format_footer_text(suggestion_event) == "someone \"hi\""