def test_add_and_retreive_quote(self): """ Try adding a quote, then retrieving it """ id = str(uuid.uuid4()) quote = "So I says to Mabel, I says, %s" % id res = quotes.quote("add %s" % quote) assert res == "Quote added!" cursor = logging.Logger.store.db.cursor() cursor.execute("select count(*) from quotes where library = 'pmx' and quote = ?", (quote,)) numquotes = cursor.fetchone()[0] assert numquotes == 1 res = quotes.quote(id) assert res == "(1/1): %s" % quote
def test_add_quote(self): """ Try adding a quote """ quote = "And then she said %s" % str(uuid.uuid4()) res = quotes.quote("add %s" % quote) assert res == "Quote added!" cursor = logging.Logger.store.db.cursor() cursor.execute("select count(*) from quotes where library = 'pmx' and quote = ?", (quote,)) numquotes = cursor.fetchone()[0] assert numquotes == 1