Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mega.py
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
richardARPANET
mega.py
Commits
13cb3b56
Commit
13cb3b56
authored
Nov 06, 2019
by
richardARPANET
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing
parent
b87694e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
4 deletions
+50
-4
src/mega/mega.py
src/mega/mega.py
+7
-3
src/tests/test_crypto.py
src/tests/test_crypto.py
+42
-0
src/tests/test_mega.py
src/tests/test_mega.py
+0
-0
tox.ini
tox.ini
+1
-1
No files found.
src/mega/mega.py
View file @
13cb3b56
...
...
@@ -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
(
...
...
src/tests/test_crypto.py
0 → 100644
View file @
13cb3b56
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
src/tests/test
s
.py
→
src/tests/test
_mega
.py
View file @
13cb3b56
File moved
tox.ini
View file @
13cb3b56
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment