コード例 #1
0
async def test_soundboardCommand_sequential(command):
    prompt1 = bot.CommandPrompt(command, "Test UserName", True, None, None)
    result1 = await bot.processCommand(prompt1)
    assert result1 != None
    prompt2 = bot.CommandPrompt(command, "Test UserName", True, None, None)
    result2 = await bot.processCommand(prompt2)
    assert result2 != None
コード例 #2
0
async def test_stopSoundboardCommand():
    prompt1 = bot.CommandPrompt("/thiemo", "Test UserName", True, None, None)
    command1 = bot.processCommand(prompt1)
    prompt2 = bot.CommandPrompt("/stop", "Test UserName", True, None, None)
    result2 = await bot.processCommand(prompt2)
    result1 = await command1
    assert result1 != None and result1.succeeded() and result2 != None
コード例 #3
0
async def test_corruption(command, admin):
    prompt_corrupt = bot.CommandPrompt(command, "Test UserName", admin, None,
                                       None)
    result_corrupt = await bot.processCommand(prompt_corrupt)
    assert result_corrupt != None
    prompt_roll = bot.CommandPrompt("/roll 8", "Test UserName", admin, None,
                                    None)
    result_roll = await bot.processCommand(prompt_roll)
    assert result_roll != None
コード例 #4
0
async def test_simpleReplies(command):
    prompt_admin = bot.CommandPrompt(command, "Test UserName", True, None,
                                     None)
    result_admin = await bot.processCommand(prompt_admin)
    assert result_admin != None

    prompt_user = bot.CommandPrompt(command, "Test UserName", False, None,
                                    None)
    result_user = await bot.processCommand(prompt_user)
    assert result_user != None
コード例 #5
0
async def test_shutdown(command, admin):
    prompt = bot.CommandPrompt(command, "Test UserName", admin, None, None)
    if admin:
        with pytest.raises(SystemExit) as e:
            await bot.processCommand(prompt)
        assert e.type == SystemExit
        assert e.value.code == 0
    else:
        result = await bot.processCommand(prompt)
        assert result != None
コード例 #6
0
async def test_extend(command):
    prompt = bot.CommandPrompt(command, "Test UserName", True, None, None)
    result = await bot.processCommand(prompt)
    assert result != None
コード例 #7
0
async def test_coinflip():
    prompt = bot.CommandPrompt("/coinflip", "Test UserName", True, None, None)
    for i in range(100):
        result = await bot.processCommand(prompt)
        assert result != None
コード例 #8
0
async def test_init(command):
    prompt = bot.CommandPrompt(command, "Test UserName", True, None, None)
    for i in range(100):
        result = await bot.processCommand(prompt)
        assert result != None
コード例 #9
0
async def test_soundlist():
    prompt = bot.CommandPrompt("/soundlist", "Test UserName", True, None, None)
    for i in range(100):
        result = await bot.processCommand(prompt)
        assert result != None
コード例 #10
0
async def test_soundboardCommand(command, responseValid):
    prompt = bot.CommandPrompt("/thiemo", "Test UserName", True, None, None)
    result = await bot.processCommand(prompt)
    assert not responseValid or (result != None and result.succeeded() == True)
コード例 #11
0
async def test_customCommands(command, response):
    prompt = bot.CommandPrompt(command, "Test UserName", False, None, None)
    result = await bot.processCommand(prompt)
    assert (result == None and response == None) or (result.message
                                                     == response)
コード例 #12
0
async def test_choose(command):
    prompt = bot.CommandPrompt(command, "Test UserName", False, None, None)
    result = await bot.processCommand(prompt)
    assert result != None
コード例 #13
0
async def test_echoSoft(str, echo):
    prompt = bot.CommandPrompt("/echosoft " + str, "Test UserName", False,
                               None, None)
    result = await bot.processCommand(prompt)
    assert result.message == echo
コード例 #14
0
async def test_cleanup(command, admin):
    prompt = bot.CommandPrompt(command, "Test UserName", admin, None, None)
    result = await bot.processCommand(prompt)
    assert result != None