Skip to content

Commit

Permalink
test(test-case): adds test case for user metadata snashot
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Aug 6, 2024
1 parent 2b8d23f commit 2c3593d
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions tests/test_API.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,84 @@ def test_snapshot_bind_zip():
wait_for_task_completion(track_link)


def test_snapshot_bind_zip():
headers = {"access-token": access_token}
payload = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
"bindZip": False,
}

response = client.post("/v1/snapshot/", json=payload, headers=headers)

assert response.status_code == 200
res = response.json()
track_link = res["track_link"]
wait_for_task_completion(track_link)


## Test snapshot include user metadata


def test_snapshot_with_user_meatadata():
headers = {"access-token": access_token}
payload = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
"includeUserMetadata": True,
}

response = client.post("/v1/snapshot/", json=payload, headers=headers)

assert response.status_code == 200
res = response.json()
track_link = res["track_link"]
wait_for_task_completion(track_link)


def test_snapshot_with_user_meatadata_without_login():
# headers = {"access-token": access_token}
payload = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
"includeUserMetadata": True,
}

response = client.post("/v1/snapshot/", json=payload)

assert response.status_code == 403


## Snapshot Plain


Expand Down

0 comments on commit 2c3593d

Please sign in to comment.