示例#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)