cli: fixes testing for ConnectionError in get_appointment

This commit is contained in:
Bjarne Magnussen
2020-03-24 17:59:44 +01:00
parent 8d2c17884a
commit 8ef7b44fd0

View File

@@ -3,6 +3,7 @@ import json
import shutil import shutil
import responses import responses
from coincurve import PrivateKey from coincurve import PrivateKey
from requests.exceptions import ConnectionError
import common.cryptographer import common.cryptographer
from common.logger import Logger from common.logger import Logger
@@ -235,7 +236,7 @@ def test_get_appointment_err():
get_appointment_endpoint = teos_endpoint + "get_appointment" get_appointment_endpoint = teos_endpoint + "get_appointment"
# Test that get_appointment handles a connection error appropriately. # Test that get_appointment handles a connection error appropriately.
request_url = "{}?locator=".format(get_appointment_endpoint, locator) request_url = "{}?locator={}".format(get_appointment_endpoint, locator)
responses.add(responses.GET, request_url, body=ConnectionError()) responses.add(responses.GET, request_url, body=ConnectionError())
assert not teos_cli.get_appointment(locator, get_appointment_endpoint) assert not teos_cli.get_appointment(locator, get_appointment_endpoint)