mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
Adds some missing tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import pytest
|
||||
import requests
|
||||
from os import urandom
|
||||
from hashlib import sha256
|
||||
from binascii import unhexlify
|
||||
|
||||
@@ -99,6 +100,16 @@ def test_request_appointment(new_appointment):
|
||||
assert (all([status == "being_watched" for status in appointment_status]))
|
||||
|
||||
|
||||
def test_request_random_appointment():
|
||||
r = requests.get(url=PISA_API + "/get_appointment?locator=" + urandom(32).hex())
|
||||
assert (r.status_code == 200)
|
||||
|
||||
received_appointments = json.loads(r.content)
|
||||
appointment_status = [appointment.pop("status") for appointment in received_appointments]
|
||||
|
||||
assert (all([status == "not_found" for status in appointment_status]))
|
||||
|
||||
|
||||
def test_add_appointment_multiple_times(new_appointment, n=MULTIPLE_APPOINTMENTS):
|
||||
# Multiple appointments with the same locator should be valid
|
||||
# DISCUSS: #34-store-identical-appointments
|
||||
|
||||
Reference in New Issue
Block a user