Commit 13cb3b56 authored by richardARPANET's avatar richardARPANET

testing

parent b87694e7
......@@ -569,8 +569,8 @@ class Mega:
Download a file by it's file object
"""
self._download_file(
None,
None,
file_handle=None,
file_key=None,
file=file[1],
dest_path=dest_path,
dest_filename=dest_filename,
......@@ -647,7 +647,11 @@ class Mega:
file_id = path[0]
file_key = path[1]
self._download_file(
file_id, file_key, dest_path, dest_filename, is_public=True
file_handle=file_id,
file_key=file_key,
dest_path=dest_path,
dest_filename=dest_filename,
is_public=True,
)
def _download_file(
......
import pytest
from mega.crypto import get_chunks
@pytest.mark.parametrize(
'file_size, exp_result', [
(
10,
(
(0, 10),
)
),
(
1000,
(
(0, 1000),
)
),
(
1000000,
(
(0, 131072), (131072, 262144), (393216, 393216),
(786432, 213568)
)
),
(
10000000,
(
(0, 131072), (131072, 262144), (393216, 393216),
(786432, 524288), (1310720, 655360), (1966080, 786432),
(2752512, 917504), (3670016, 1048576), (4718592, 1048576),
(5767168, 1048576), (6815744, 1048576), (7864320, 1048576),
(8912896, 1048576), (9961472, 38528)
)
),
]
)
def test_get_chunks(file_size, exp_result):
result = tuple(get_chunks(file_size))
assert result == exp_result
......@@ -6,7 +6,7 @@ commands =
flake8 {toxinidir}/src/
coverage erase
python setup.py install
pytest {toxinidir}/src/tests/tests.py
pytest {toxinidir}/src/tests/
passenv =
EMAIL
PASS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment