Skip to content

Commit 51a0434

Browse files
committed
Merge pull request #143 from forrest-mao/master
fix fix fix
2 parents 0fc7f1c + 7acdb80 commit 51a0434

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test_qiniu.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# flake8: noqa
3-
import os
3+
import os
44
import string
55
import random
66
import tempfile
7+
import requests
78

89
import unittest
910
import pytest
@@ -306,6 +307,19 @@ def test_retry(self):
306307
assert ret['key'] == key
307308
qiniu.set_default(default_up_host=qiniu.config.UPAUTO_HOST)
308309

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+
309323

310324
class MediaTestCase(unittest.TestCase):
311325
def test_pfop(self):

0 commit comments

Comments
 (0)