@@ -115,9 +115,9 @@ def test_bad_upload_types(self, dbx):
115
115
def test_team (self , dbxt ):
116
116
dbxt .team_groups_list ()
117
117
r = dbxt .team_members_list ()
118
- if r .members : # pylint: disable=no-member
118
+ if r .members :
119
119
# Only test assuming a member if there is a member
120
- team_member_id = r .members [0 ].profile .team_member_id # pylint: disable=no-member
120
+ team_member_id = r .members [0 ].profile .team_member_id
121
121
dbxt .as_user (team_member_id ).files_list_folder ('' )
122
122
123
123
@@ -190,7 +190,7 @@ def test_account_info(self, dbx_client):
190
190
@dbx_v1_client_from_env_with_test_dir
191
191
def test_put_file (self , dbx_client , test_dir ):
192
192
"""Tests if put_file returns the expected metadata"""
193
- def test_put (file , path ): # pylint: disable=redefined-builtin,useless-suppression
193
+ def test_put (file , path ): # pylint: disable=redefined-builtin
194
194
file_path = posixpath .join (test_dir , path )
195
195
f = open (file , "rb" )
196
196
metadata = dbx_client .put_file (file_path , f )
@@ -218,7 +218,7 @@ def test_put_file_overwrite(self, dbx_client, test_dir):
218
218
@dbx_v1_client_from_env_with_test_dir
219
219
def test_get_file (self , dbx_client , test_dir ):
220
220
"""Tests if storing and retrieving a file returns the same file"""
221
- def test_get (file , path ): # pylint: disable=redefined-builtin,useless-suppression
221
+ def test_get (file , path ): # pylint: disable=redefined-builtin
222
222
file_path = posixpath .join (test_dir , path )
223
223
self .upload_file (dbx_client , file , file_path )
224
224
downloaded = dbx_client .get_file (file_path ).read ()
@@ -232,7 +232,7 @@ def test_get(file, path): # pylint: disable=redefined-builtin,useless-suppressi
232
232
@dbx_v1_client_from_env_with_test_dir
233
233
def test_get_partial_file (self , dbx_client , test_dir ):
234
234
"""Tests if storing a file and retrieving part of it returns the correct part"""
235
- def test_get (file , path , start_frac , download_frac ): # noqa: E501; pylint: disable=redefined-builtin,useless-suppression
235
+ def test_get (file , path , start_frac , download_frac ): # noqa: E501; pylint: disable=redefined-builtin
236
236
file_path = posixpath .join (test_dir , path )
237
237
self .upload_file (dbx_client , file , file_path )
238
238
local = open (file , "rb" ).read ()
@@ -241,7 +241,7 @@ def test_get(file, path, start_frac, download_frac): # noqa: E501; pylint: disa
241
241
download_start = int (start_frac * local_len ) if start_frac is not None else None
242
242
download_length = int (download_frac * local_len ) if download_frac is not None else None
243
243
downloaded = dbx_client .get_file (file_path , start = download_start ,
244
- length = download_length ).read ()
244
+ length = download_length ).read ()
245
245
246
246
local_file = open (file , "rb" )
247
247
if download_start :
@@ -489,13 +489,20 @@ def test_chunked_upload2(self, dbx_client, test_dir):
489
489
self .assertEqual (new_offset , chunk_size )
490
490
self .assertIsNotNone (upload_id )
491
491
492
- new_offset , upload_id2 = dbx_client .upload_chunk (BytesIO (random_data2 ), 0 ,
493
- new_offset , upload_id )
492
+ new_offset , upload_id2 = dbx_client .upload_chunk (
493
+ BytesIO (random_data2 ),
494
+ 0 ,
495
+ new_offset ,
496
+ upload_id ,
497
+ )
494
498
self .assertEqual (new_offset , chunk_size * 2 )
495
499
self .assertEqual (upload_id2 , upload_id )
496
500
497
- metadata = dbx_client .commit_chunked_upload ('/auto' + target_path , upload_id ,
498
- overwrite = True )
501
+ metadata = dbx_client .commit_chunked_upload (
502
+ '/auto' + target_path ,
503
+ upload_id ,
504
+ overwrite = True ,
505
+ )
499
506
self .dict_has (metadata , bytes = chunk_size * 2 , path = target_path )
500
507
501
508
downloaded = dbx_client .get_file (target_path ).read ()
@@ -544,12 +551,14 @@ def test_delta(self, dbx_client, test_dir):
544
551
cursor = None
545
552
while True :
546
553
r = dbx_client .delta (cursor )
547
- if r ['reset' ]: entries = set ()
554
+ if r ['reset' ]:
555
+ entries = set ()
548
556
for path_lc , md in r ['entries' ]:
549
- if path_lc .startswith (prefix_lc + '/' ) or path_lc == prefix_lc :
557
+ if path_lc .startswith (prefix_lc + '/' ) or path_lc == prefix_lc :
550
558
assert md is not None , "we should never get deletes under 'prefix'"
551
559
entries .add (path_lc )
552
- if not r ['has_more' ]: break
560
+ if not r ['has_more' ]:
561
+ break
553
562
cursor = r ['cursor' ]
554
563
555
564
self .assertEqual (expected , entries )
@@ -560,12 +569,14 @@ def test_delta(self, dbx_client, test_dir):
560
569
cursor = None
561
570
while True :
562
571
r = dbx_client .delta (cursor , path_prefix = c )
563
- if r ['reset' ]: entries = set ()
572
+ if r ['reset' ]:
573
+ entries = set ()
564
574
for path_lc , md in r ['entries' ]:
565
- assert path_lc .startswith (c_lc + '/' ) or path_lc == c_lc
575
+ assert path_lc .startswith (c_lc + '/' ) or path_lc == c_lc
566
576
assert md is not None , "we should never get deletes"
567
577
entries .add (path_lc )
568
- if not r ['has_more' ]: break
578
+ if not r ['has_more' ]:
579
+ break
569
580
cursor = r ['cursor' ]
570
581
571
582
self .assertEqual (expected , entries )
0 commit comments