mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-18 15:28:11 +00:00
Use aiofiles where relevant.
This commit is contained in:
@ -293,15 +293,6 @@ def test_json(compute):
|
||||
}
|
||||
|
||||
|
||||
def test_streamFile(project, async_run, compute):
|
||||
response = MagicMock()
|
||||
response.status = 200
|
||||
with asyncio_patch("aiohttp.ClientSession.request", return_value=response) as mock:
|
||||
async_run(compute.stream_file(project, "test/titi", timeout=120))
|
||||
mock.assert_called_with("GET", "https://example.com:84/v2/compute/projects/{}/stream/test/titi".format(project.id), auth=None, timeout=120)
|
||||
async_run(compute.close())
|
||||
|
||||
|
||||
def test_downloadFile(project, async_run, compute):
|
||||
response = MagicMock()
|
||||
response.status = 200
|
||||
@ -310,6 +301,7 @@ def test_downloadFile(project, async_run, compute):
|
||||
mock.assert_called_with("GET", "https://example.com:84/v2/compute/projects/{}/files/test/titi".format(project.id), auth=None)
|
||||
async_run(compute.close())
|
||||
|
||||
|
||||
def test_close(compute, async_run):
|
||||
assert compute.connected is True
|
||||
async_run(compute.close())
|
||||
|
Reference in New Issue
Block a user