Ejemplo n.º 1
0
def test_rename_task():
    temp_id = generate_unique_id()
    add_response = requests.post(BASE_URL, json=payload.Payload.add_new_task_payload(temp_id))
    task_id = add_response.json()["temp_id_mapping"][temp_id]
    rename_response = requests.post(BASE_URL, json=payload.Payload.rename_task_payload(task_id))
    assert_that(rename_response.status_code, equal_to(200))
    assert_that(rename_response.json()["sync_token"], not_none())
    assert_that(rename_response.json()["full_sync"], equal_to(True))
Ejemplo n.º 2
0
 def complete_task(task_id):
     return {
         "token": TOKEN,
         "type": Type.ITEM_COMPLETE,
         "uuid": generate_unique_id(),
         "args": {
             "id": task_id
         }
     }
Ejemplo n.º 3
0
def test_add_new_task():
    temp_id = generate_unique_id()
    response = requests.post(
        BASE_URL, json=payload.Payload.add_new_task_payload(temp_id))
    assert_that(response.json()["full_sync"], equal_to(True))
    assert_that(response.json()["sync_token"], not_none())
    assert_that(
        list(response.json()["temp_id_mapping"].keys())[0], equal_to(temp_id))
    assert_that(response.status_code, equal_to(200),
                "Task is not created successfully")
    assert_that(response.json()["temp_id_mapping"][temp_id], not_none())
Ejemplo n.º 4
0
 def rename_task_payload(task_id):
     return {
         "token":
         TOKEN,
         "commands": [{
             "type": Type.ITEM_UPDATE,
             "uuid": generate_unique_id(),
             "args": {
                 "id": task_id,
                 "content": "RenameTask"
             }
         }]
     }
Ejemplo n.º 5
0
 def add_new_task_payload(temp_id):
     return {
         "token":
         TOKEN,
         "commands": [{
             "type": Type.ITEM_ADD,
             "temp_id": temp_id,
             "uuid": generate_unique_id(),
             "args": {
                 "content": "TaskNewDivya5",
                 "due": {
                     "date": "2021-03-22"
                 }
             }
         }]
     }