Commit 5888ce13 authored by Richard's avatar Richard Committed by GitHub

Merge pull request #3 from richardARPANET/misc-improvements

Misc improvements
parents 5197766e 54ba916c
......@@ -6,7 +6,10 @@ Release History
1.0.1 (unreleased)
------------------
- Nothing changed yet.
- When a request fails due to EAGAIN response, retry with exp backoff up to 20 seconds.
- Adds logging, removes print statements.
- Replace pycrypto dependency with pycryptodome.
- Removes Python 2 specific code.
1.0.0 (2019-10-31)
......
......@@ -56,8 +56,6 @@ Create an instance of Mega.py
.. code:: python
mega = Mega()
# add the verbose option for print output on some functions
mega = Mega({'verbose': True})
Login to Mega
~~~~~~~~~~~~~
......
This diff is collapsed.
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