Example #1
0
def test_linkifytext_with_many_paranthesis(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('@k(o(v)a)())s: my(( test) message', team, channel)

    assert text == '@k(o(v)a)())s: my(( test) message'
Example #2
0
def test_linkifytext_formatting_characters(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('\x02\x1Dmy test message\x1D\x02', team, channel)

    assert text == '*_my test message_*'
Example #3
0
def test_linkifytext_names_with_accents(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('@ÁrvíztűrőTükörfúrógép(atukorfurogep): my test message', team, channel)

    assert text == '@ÁrvíztűrőTükörfúrógép(atukorfurogep): my test message'
Example #4
0
def test_linkifytext_names_with_paranthesis(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('@JohnDoe(jdoe): my test message', team, channel)

    assert text == '@JohnDoe(jdoe): my test message'
Example #5
0
def test_linkifytext_names_with_apostrophe(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('@O\'Connor: my test message', team, channel)

    assert text == '@O\'Connor: my test message'
Example #6
0
def test_linkifytext_names_with_subgroup_notification(team):
    subteam = team.subteams['TGX0ALBK3']
    message = 'This is a message for a subteam'
    text = linkify_text('{}: {}'.format(subteam.handle, message), team)

    assert text == '<!subteam^{}|{}>: {}'.format(subteam.identifier,
                                                 subteam.handle, message)
Example #7
0
def test_linkifytext_does_partial_html_entity_encoding(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('& < > \' "', team, channel)

    assert text == '&amp; &lt; &gt; \' "'
Example #8
0
def test_linkifytext_does_partial_html_entity_encoding(realish_eventrouter):
    team = realish_eventrouter.teams.values()[0]
    channel = team.channels.values()[0]

    text = linkify_text('& < > \' "', team, channel)

    assert text == '&amp; &lt; &gt; \' "'
Example #9
0
def test_linkifytext_names_with_paranthesis(team):
    text = linkify_text('@JohnDoe(jdoe): my test message', team)

    assert text == '@JohnDoe(jdoe): my test message'
Example #10
0
def test_linkifytext_not_private_using_ampersand(team, channel_private):
    channel_name = re.sub(r'^[#&]', '', channel_private.name)
    text = linkify_text('&{}: my test message'.format(channel_name), team)

    assert text == '&amp;{}: my test message'.format(channel_name)
Example #11
0
def test_linkifytext_does_partial_html_entity_encoding(team):
    text = linkify_text('& < > \' "', team)

    assert text == '&amp; &lt; &gt; \' "'
Example #12
0
def test_linkifytext_channel(team, channel_general):
    channel_name = re.sub(r'^[#&]', '', channel_general.name)
    text = linkify_text('#{}: my test message'.format(channel_name), team)

    assert text == '<#{}|{}>: my test message'.format(channel_general.id,
                                                      channel_name)
Example #13
0
def test_linkifytext_at_here(team):
    text = linkify_text('@here: my test message', team)

    assert text == '<!here>: my test message'
Example #14
0
def test_linkifytext_names_with_paranthesis(team):
    text = linkify_text('@JohnDoe(jdoe): my test message', team)

    assert text == '@JohnDoe(jdoe): my test message'
Example #15
0
def test_linkifytext_with_many_paranthesis(team):
    text = linkify_text('@k(o(v)a)())s: my(( test) message', team)

    assert text == '@k(o(v)a)())s: my(( test) message'
Example #16
0
def test_linkifytext_channel(team, channel_general):
    channel_name = re.sub(r'^[#&]', '', channel_general.name)
    text = linkify_text('#{}: my test message'.format(channel_name), team)

    assert text == '<#{}|{}>: my test message'.format(channel_general.id, channel_name)
Example #17
0
def test_linkifytext_names_with_subgroup_notification(team):
    subteam = team.subteams['TGX0ALBK3']
    message = 'This is a message for a subteam'
    text = linkify_text('@{}: {}'.format(subteam.handle, message), team)

    assert text == '<!subteam^{}|@{}>: {}'.format(subteam.identifier, subteam.handle, message)
Example #18
0
def test_linkifytext_names_with_apostrophe(team):
    text = linkify_text('@O\'Connor: my test message', team)

    assert text == '@O\'Connor: my test message'
Example #19
0
def test_linkifytext_with_many_paranthesis(team):
    text = linkify_text('@k(o(v)a)())s: my(( test) message', team)

    assert text == '@k(o(v)a)())s: my(( test) message'
Example #20
0
def test_linkifytext_formatting_characters(team):
    text = linkify_text('\x02\x1Dmy test message\x1D\x02', team)

    assert text == '*_my test message_*'
Example #21
0
def test_linkifytext_names_with_accents(team):
    text = linkify_text(
        '@ÁrvíztűrőTükörfúrógép(atukorfurogep): my test message', team)

    assert text == '@ÁrvíztűrőTükörfúrógép(atukorfurogep): my test message'
Example #22
0
def test_linkifytext_names_with_accents(team):
    text = linkify_text('@ÁrvíztűrőTükörfúrógép(atukorfurogep): my test message', team)

    assert text == '@ÁrvíztűrőTükörfúrógép(atukorfurogep): my test message'
Example #23
0
def test_linkifytext_formatting_characters(team):
    text = linkify_text('\x02\x1Dmy test message\x1D\x02', team)

    assert text == '*_my test message_*'
Example #24
0
def test_linkifytext_at_group(team):
    text = linkify_text('@group: my test message', team)

    assert text == '<!group>: my test message'
Example #25
0
def test_linkifytext_names_with_apostrophe(team):
    text = linkify_text('@O\'Connor: my test message', team)

    assert text == '@O\'Connor: my test message'
Example #26
0
def test_linkifytext_not_mpdm(team, channel_mpdm):
    text = linkify_text('#{}: my test message'.format(channel_mpdm.name), team)

    assert text == '#{}: my test message'.format(channel_mpdm.name)
Example #27
0
def test_linkifytext_at_channel(team):
    text = linkify_text('@channel: my test message', team)

    assert text == '<!channel>: my test message'
Example #28
0
def test_linkifytext_at_channel(team):
    text = linkify_text('@channel: my test message', team)

    assert text == '<!channel>: my test message'
Example #29
0
def test_linkifytext_does_partial_html_entity_encoding(team):
    text = linkify_text('& < > \' "', team)

    assert text == '&amp; &lt; &gt; \' "'
Example #30
0
def test_linkifytext_at_everyone(team):
    text = linkify_text('@everyone: my test message', team)

    assert text == '<!everyone>: my test message'