Exemplo n.º 1
0
async def test_random_mmeme(bot: ICBOT):
    await dpytest.message(f"{PREFIX} copiepate")
    assert "copie-pates" in CHANNELS
    assert ErrorMessages.COMMAND_NOT_FOUND.format(
        "copiepate") not in dpytest.get_embed(peek=True).description
    assert not dpytest.verify().message().peek().nothing()
    message = dpytest.get_embed()
    assert len(message.image) > 0
Exemplo n.º 2
0
async def test_drive(bot):
    await dpytest.message(f"{PREFIX} drive")
    assert not dpytest.verify().message().nothing()
    message = dpytest.get_embed()

    from ICBOT.exceptions import NoArgument
    assert dpytest.embed_eq(
        message,
        NoArgument(StandardCommands.DRIVE.name).to_message())

    await dpytest.message(f"{PREFIX} drive test")
    from ICBOT.exceptions import InvalidArgument
    assert dpytest.embed_eq(
        dpytest.get_embed(),
        InvalidArgument(ErrorMessages.DRIVE_NO_FILE_SPECIFIED).to_message())
Exemplo n.º 3
0
async def test_help(bot, help_message):
    await dpytest.message(f"{PREFIX} aide")
    assert ErrorMessages.COMMAND_NOT_FOUND.format(
        "aide") not in dpytest.get_embed(peek=True).description
    assert not dpytest.verify().message().nothing()
    a = await Help.build_with_args()
    assert dpytest.verify().message().embed(help_message)
Exemplo n.º 4
0
async def test_get_embed_peek(bot):
    """Dont use this in your code, it's just dummy test.
    Use verify_embed() instead of 'get_embed'
    """
    guild = bot.guilds[0]
    channel = guild.text_channels[0]

    embed = discord.Embed(title="Test Embed")
    embed.add_field(name="Field 1", value="Lorem ipsum")

    await channel.send(embed=embed)
    emb = dpytest.get_embed(peek=True)
    assert emb.title == "Test Embed"