1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Fix HTTP errors not forwarded from compute to client

Fix #615
This commit is contained in:
Julien Duponchelle 2016-07-11 09:33:55 +02:00
parent 50aa198ba7
commit 9bf4c22a50
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
2 changed files with 47 additions and 39 deletions

View File

@ -289,6 +289,14 @@ def test_forward_get(compute, async_run):
mock.assert_called_with("GET", "https://example.com:84/v2/compute/qemu/images", auth=None, data=None, headers={'content-type': 'application/json'}, chunked=False)
def test_forward_404(compute, async_run):
response = MagicMock()
response.status = 404
with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock:
with pytest.raises(aiohttp.web_exceptions.HTTPNotFound):
async_run(compute.forward("GET", "qemu", "images"))
def test_forward_post(compute, async_run):
response = MagicMock()
response.status = 200