@@ -70,51 +70,3 @@ async def test_download_range(self):
70
70
assert int (downloaded_file .content_length ) == len (downloaded_file .content )
71
71
72
72
await client .close ()
73
-
74
- @pytest .mark .asyncio
75
- @pytest .mark .order (2 )
76
- async def test_download_params (self ):
77
- client = Client (os .environ ['KEY_ID' ], os .environ ['KEY' ], log_level = logging .DEBUG )
78
- file = ValueStorage .test_upload_file
79
- assert isinstance (file , File )
80
-
81
- content_disposition = f'attachment; filename="filename.jpg"'
82
- content_language = 'de-DE'
83
- expires = 'Wed, 21 Oct 2015 07:28:00 GMT'
84
- # TODO: this is a valid value for cache-control, but DownloadedFile tries to parse it as a timestamp
85
- # cache_control = 'max-age=604800, must-revalidate'
86
- content_encoding = 'compress'
87
- content_type = 'text/html;charset=utf-8'
88
-
89
- downloaded_file = await client .download_file_by_name (
90
- file_name = file .name ,
91
- bucket_name = os .environ ['BUCKET_NAME' ],
92
- content_disposition = content_disposition ,
93
- content_language = content_language ,
94
- expires = expires ,
95
- # cache_control=cache_control,
96
- content_encoding = content_encoding ,
97
- content_type = content_type
98
- )
99
-
100
- assert downloaded_file .name == file .name
101
- assert downloaded_file .id == file .id
102
- assert downloaded_file .content == path .read_bytes ()
103
- assert downloaded_file .content_disposition == content_disposition
104
- assert downloaded_file .content_language == content_language
105
- # TODO: cache-control header is not exposed by DownloadedFile, and the logic that sets expires needs some
106
- # attention
107
- # assert downloaded_file.cache_control == cache_control
108
- # assert downloaded_file.expires == expires
109
- assert downloaded_file .content_encoding == content_encoding
110
- assert downloaded_file .content_type == content_type
111
-
112
- # Download (by id)
113
-
114
- downloaded_file = await client .download_file_by_id (file_id = file .id )
115
-
116
- assert downloaded_file .name == file .name
117
- assert downloaded_file .id == file .id
118
- assert downloaded_file .content == path .read_bytes ()
119
-
120
- await client .close ()
0 commit comments