Skip to content

Commit fa0b457

Browse files
committed
test-env.sh
1 parent cba796c commit fa0b457

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
*.py[cod]
66

7+
my-test-env.sh
78

89
##
910
## from https://github.com/github/gitignore/blob/master/Python.gitignore

docs/demo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _setup():
5252
secret_key = getenv("QINIU_SECRET_KEY")
5353
bucket_name = getenv("QINIU_BUCKET_NAME")
5454
domain = getenv("QINIU_DOMAIN")
55-
pickey = getenv("QINIU_PIC_KEY")
55+
pickey = 'QINIU_UNIT_TEST_PIC'
5656
setup(access_key, secret_key, bucket_name, domain, pickey)
5757

5858
def getenv(name):

env.sh

-6
This file was deleted.

qiniu/rs/test/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import qiniu.conf
88

99
pic = "http://cheneya.qiniudn.com/hello_jpg"
10+
key = 'QINIU_UNIT_TEST_PIC'
1011

1112
def setUp():
1213
qiniu.conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
1314
qiniu.conf.SECRET_KEY = os.getenv("QINIU_SECRET_KEY")
14-
key = os.getenv("QINIU_PIC_KEY")
1515
bucket_name = os.getenv("QINIU_BUCKET_NAME")
1616

1717
policy = qiniu.rs.PutPolicy(bucket_name)

qiniu/rs/test/rs_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def r(length):
1313

1414
conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
1515
conf.SECRET_KEY = os.getenv("QINIU_SECRET_KEY")
16-
key = os.getenv("QINIU_PIC_KEY")
16+
key = 'QINIU_UNIT_TEST_PIC'
1717
bucket_name = os.getenv("QINIU_BUCKET_NAME")
18-
noexist_key = os.getenv("QINIU_NOEXIST_PIC_KEY")
18+
noexist_key = 'QINIU_UNIT_TEST_NOEXIST' + r(30)
1919
key2 = "rs_demo_test_key_1_" + r(5)
2020
key3 = "rs_demo_test_key_2_" + r(5)
2121
key4 = "rs_demo_test_key_3_" + r(5)

qiniu/rs/test/rs_token_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
conf.SECRET_KEY = os.getenv("QINIU_SECRET_KEY")
1717
bucket_name = os.getenv("QINIU_BUCKET_NAME")
1818
domain = os.getenv("QINIU_DOMAIN")
19-
key = os.getenv("QINIU_PIC_KEY")
19+
key = 'QINIU_UNIT_TEST_PIC'
2020

2121
class TestToken(unittest.TestCase):
2222
def test_put_policy(self):

test-env.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export QINIU_ACCESS_KEY="<access_key>"
2+
export QINIU_SECRET_KEY="<secret_key>"
3+
export QINIU_BUCKET_NAME="<bucket_name>"
4+
export QINIU_DOMAIN="<bucket_domain>"

0 commit comments

Comments
 (0)