Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dropbox/dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ def request(self,
"""
host = route.attrs['host'] or 'api'
route_name = namespace + '/' + route.name
if route.version > 1:
route_name += '_v{}'.format(route.version)
route_style = route.attrs['style'] or 'rpc'
serialized_arg = stone_serializers.json_encode(route.arg_type,
request_arg)
Expand Down
12 changes: 12 additions & 0 deletions test/test_dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
PathRootError,
)
from dropbox.files import (
DeleteResult,
ListFolderError,
)
from dropbox.common import (
Expand Down Expand Up @@ -191,6 +192,17 @@ def test_path_root_err(self, dbx):
dbxpr.files_list_folder('')
self.assertTrue(cm.exception.error.is_invalid_root())

@dbx_from_env
def test_versioned_route(self, dbx):
# Upload a test file
path = '/test.txt'
dbx.files_upload(DUMMY_PAYLOAD, path)

# Delete the file with v2 route
resp = dbx.files_delete_v2(path)
# Verify response type is of v2 route
self.assertIsInstance(resp, DeleteResult)

class TestDropboxTeam(unittest.TestCase):
@dbx_team_from_env
def test_team(self, dbxt):
Expand Down