예제 #1
0
def test_random_quote_author():
    # On tire une douzaine de quotes avec un auteur et check chacune d'entre elle
    for i in range(12):
        quote = random_quote([
            "Vincent V.K.", "Stefano S.", "Claire T.B.", "Jean-Caude Van Dam"
        ][randint(0, 3)])
        assert (quote.text and quote.author)
예제 #2
0
파일: bot.py 프로젝트: fanfan-62/Bot
async def citation(ctx, arg=None):
    # On choisi une citation
    quote = random_quote(arg)

    # On créé un embed
    embed = Embed(title=quote.text)
    embed.set_footer(text=quote.author)

    # On envoit
    await ctx.send(embed=embed)
    await ctx.message.delete()
예제 #3
0
def get_random_quote():
    q = quotes.random_quote()
    return f"{q['quote']}\n\n- {q['author']}"
예제 #4
0
파일: app.py 프로젝트: nickwu241/quotes
def quotes_random():
    return jsonify(quotes.random_quote())
예제 #5
0
def test_random_quote():
    # On tire une douzaine de quotes et check chacune d'entre elle
    for i in range(12):
        quote = random_quote()
        assert(quote.text and quote.author)