mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Merge pull request #113 from bjarnemagnussen/master
cli: fixes testing for `ConnectionError` in `get_appointment`
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user