File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
# flake8: noqa
3
- import os
3
+ import os
4
4
import string
5
5
import random
6
6
import tempfile
7
+ import requests
7
8
8
9
import unittest
9
10
import pytest
@@ -306,6 +307,19 @@ def test_retry(self):
306
307
assert ret ['key' ] == key
307
308
qiniu .set_default (default_up_host = qiniu .config .UPAUTO_HOST )
308
309
310
+ class DownloadTestCase (unittest .TestCase ):
311
+
312
+ q = Auth (access_key , secret_key )
313
+
314
+ def test_private_url (self ):
315
+ private_bucket = 'private-res'
316
+ private_key = 'gogopher.jpg'
317
+ base_url = 'http://%s/%s' % (private_bucket + '.qiniudn.com' , private_key )
318
+ private_url = self .q .private_download_url (base_url , expires = 3600 )
319
+ print (private_url )
320
+ r = requests .get (private_url )
321
+ assert r .status_code == 200
322
+
309
323
310
324
class MediaTestCase (unittest .TestCase ):
311
325
def test_pfop (self ):
You can’t perform that action at this time.
0 commit comments