Ejemplo n.º 1
0
    def _():
        output = tasks.format_tasks(tasks.list_tasks(client))

        assert 'Test task 1' in output
        assert 'Test task 2' in output
        assert 'done' in output
        assert 'created' in output
Ejemplo n.º 2
0
    def run_sample():
        output = tasks.format_tasks(tasks.list_tasks(client))

        assert 'Test task 1' in output
        assert 'Test task 2' in output
        assert 'done' in output
        assert 'created' in output
Ejemplo n.º 3
0
    def run_sample():
        output = tasks.format_tasks(tasks.list_tasks(client))

        assert "Test task 1" in output
        assert "Test task 2" in output
        assert "done" in output
        assert "created" in output
Ejemplo n.º 4
0
    def _():
        output = tasks.format_tasks(tasks.list_tasks(client))

        assert "Test task 1" in output
        assert "Test task 2" in output
        assert "done" in output
        assert "created" in output
Ejemplo n.º 5
0
def test_format_tasks(client):
    task1_key = tasks.add_task(client, 'Test task 1')
    tasks.add_task(client, 'Test task 2')
    tasks.mark_done(client, task1_key.id)

    output = tasks.format_tasks(tasks.list_tasks(client))

    assert 'Test task 1' in output
    assert 'Test task 2' in output
    assert 'done' in output
    assert 'created' in output
Ejemplo n.º 6
0
def choose_list(list_name: str, update: Update, context: CallbackContext):
    list = db.get_list(list_name)
    tasks = db.get_tasks(list["id"])
    text = format_tasks(tasks)

    context.user_data["current_list"] = list

    return context.bot.send_message(
        chat_id=update.effective_message.chat_id,
        text=text,
        parse_mode=ParseMode.HTML,
    )