예제 #1
0
async def test_sub_dm_channel():
    mock_message = MockMessage(channel=MockDMChannel(_id=6))
    mock_command = MockCommand("sub", "type:nominate", context=mock_message)

    assert await receive_command(mock_command)
    assert mock_command.response.startswith("✗")
    assert "DM channel" in mock_command.response
    assert mock_command.response_embed.fields[
        0].name == mock_command.help_embed().fields[0].name
    assert mock_command.response_embed.fields[
        0].value == mock_command.help_embed().fields[0].value
    assert not subscriber.cache
예제 #2
0
async def test_sub_parenthesis_inequality():
    mock_message = MockMessage(
        channel=MockChannel(_id=6, guild=MockGuild(_id=2)))
    mock_command = MockCommand("sub", "type:(nominate", context=mock_message)

    assert await receive_command(mock_command)
    assert mock_command.response.startswith("✗")
    assert "parenthes" in mock_command.response.lower()
    assert mock_command.response_embed.fields[
        0].name == mock_command.help_embed().fields[0].name
    assert mock_command.response_embed.fields[
        0].value == mock_command.help_embed().fields[0].value
    assert not subscriber.cache
예제 #3
0
async def test_recent_dm_channel():
    mock_message = MockMessage(channel=MockDMChannel(_id=6))
    mock_command = MockCommand("recent",
                               "type:(nominate or qualify)",
                               context=mock_message)

    assert await receive_command(mock_command)

    assert mock_command.response.startswith("✗")
    assert "DM channel" in mock_command.response
    assert mock_command.response_embed.fields[
        0].name == mock_command.help_embed().fields[0].name
    assert mock_command.response_embed.fields[
        0].value == mock_command.help_embed().fields[0].value