Exemplo n.º 1
0
    async def owoify(self,
                     ctx: commands.Context,
                     level: Optional[str],
                     *,
                     text: Optional[str] = ''):
        result_text = ''
        if level is None:
            await ctx.send("You need to supply an input text!")
            return

        level = level.lower()
        if level == 'soft':
            result_text = owoify(text, 'owo')
        elif level == 'medium':
            result_text = owoify(text, 'uwu')
        elif level == 'hard':
            result_text = owoify(text, 'uvu')
        else:
            text = f'{level} {text}'
            result_text = owoify(text)
        author: discord.Member = ctx.author
        result_text = 'OwO-ified for {}~!\n\n{}'.format(
            author.mention,
            result_text.replace('`', '\\`').replace('*', '\\*'))
        await ctx.send(result_text)
Exemplo n.º 2
0
def test_long_text():
    text_with_owo = owoify(war_and_peace_text)
    text_with_uwu = owoify(war_and_peace_text, 'uwu')
    text_with_uvu = owoify(war_and_peace_text, 'uvu')
    assert text_with_owo != ''
    assert text_with_uwu != ''
    assert text_with_uvu != ''
    assert text_with_owo is not None
    assert text_with_uwu is not None
    assert text_with_uvu is not None
Exemplo n.º 3
0
def test_pokemon_names():
    for name in pokemon_names:
        name_with_owo = owoify(name)
        name_with_uwu = owoify(name, 'uwu')
        name_with_uvu = owoify(name, 'uvu')
        assert name_with_owo != ''
        assert name_with_uwu != ''
        assert name_with_uvu != ''
        assert name_with_owo is not None
        assert name_with_uwu is not None
        assert name_with_uvu is not None
Exemplo n.º 4
0
def test_owo_not_equal_to_uvu():
    assert owoify(source, 'owo') != owoify(source, 'uvu')
Exemplo n.º 5
0
def test_uwu_not_equal_to_uvu():
    assert owoify(source, 'uwu') != owoify(source, 'uvu')
Exemplo n.º 6
0
def test_undefined_level():
    with pytest.raises(RuntimeError):
        owoify(source, '123')
Exemplo n.º 7
0
def test_uvu():
    text = owoify(source, 'uvu')
    assert text != ''
    assert text is not None
Exemplo n.º 8
0
def test_owo():
    text = owoify(source, 'owo')
    assert text != ''
    assert text is not None
Exemplo n.º 9
0
def test_owoify():
    assert owoify(source, 'owo') != source
Exemplo n.º 10
0
from owoify.owoify import owoify

if __name__ == '__main__':
    print(owoify('This is the string to owo! Kinda cute isn\'t it?'))
    print(owoify('This is the string to owo! Kinda cute isn\'t it?', 'uvu'))