Merge pull request #113 from bjarnemagnussen/master

cli: fixes testing for `ConnectionError` in `get_appointment`
This commit is contained in:
Sergi Delgado Segura
2020-03-24 19:00:37 +01:00
committed by GitHub

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)