Skip to content

Commit 36ceea0

Browse files
Add HTTP range support for file downloads
1 parent c311a45 commit 36ceea0

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

test/unit/test_dropbox_unit.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
#!/usr/bin/env python
22

33
import json
4-
import mock
54
import pickle
5+
from datetime import datetime, timedelta
66

7+
import mock
78
import pytest
89
import requests
910

1011
# Tests OAuth Flow
1112
from dropbox import DropboxOAuth2Flow, session, Dropbox, create_session
13+
from dropbox.common import PathRoot
14+
from dropbox.content_hash import content_hash
1215
from dropbox.dropbox_client import (
1316
BadInputException,
1417
DropboxTeam,
1518
RouteResult,
1619
USER_AUTH,
1720
)
18-
from dropbox.content_hash import content_hash
19-
from dropbox.common import PathRoot
2021
from dropbox.exceptions import AuthError, BadInputError
2122
from dropbox.oauth import OAuth2FlowNoRedirectResult, DropboxOAuth2FlowNoRedirect
22-
from datetime import datetime, timedelta
2323

2424
APP_KEY = "dummy_app_key"
2525
APP_SECRET = "dummy_app_secret"
@@ -712,7 +712,16 @@ def _capture_upload(self, dbx, data, **upload_kwargs):
712712
# Stub out the network layer and capture the serialized argument sent.
713713
captured = {}
714714

715-
def fake_request(host, name, style, serialized_arg, auth, binary, timeout=None):
715+
def fake_request(
716+
host,
717+
name,
718+
style,
719+
serialized_arg,
720+
auth,
721+
binary,
722+
timeout=None,
723+
extra_headers=None,
724+
):
716725
captured["arg"] = json.loads(serialized_arg)
717726
return RouteResult(self._fake_file_metadata(len(data), content_hash(data)))
718727

0 commit comments

Comments
 (0)