mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Use aiofiles where relevant.
This commit is contained in:
1 parent
b0df7ecabf
commit
af80b0bb6e
17 files changed
+90
-234
No files matched your search
@@ -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