Permalink
Browse files

test-env.sh

  • Loading branch information...
1 parent cba796c commit fa0b457d0efa21f8a8f14de7a952f38076c1e40b @SunRunAway SunRunAway committed Jul 5, 2013
Showing with 10 additions and 11 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 docs/demo.py
  3. +0 −6 env.sh
  4. +1 −1 qiniu/rs/test/__init__.py
  5. +2 −2 qiniu/rs/test/rs_test.py
  6. +1 −1 qiniu/rs/test/rs_token_test.py
  7. +4 −0 test-env.sh
View
@@ -4,6 +4,7 @@
*.py[cod]
+my-test-env.sh
##
## from https://github.com/github/gitignore/blob/master/Python.gitignore
View
@@ -52,7 +52,7 @@ def _setup():
secret_key = getenv("QINIU_SECRET_KEY")
bucket_name = getenv("QINIU_BUCKET_NAME")
domain = getenv("QINIU_DOMAIN")
- pickey = getenv("QINIU_PIC_KEY")
+ pickey = 'QINIU_UNIT_TEST_PIC'
setup(access_key, secret_key, bucket_name, domain, pickey)
def getenv(name):
View
@@ -1,6 +0,0 @@
-export QINIU_ACCESS_KEY="X0XpjFmLMTJpHB_ESHjeolCtipk-1U3Ok7LVTdoN"
-export QINIU_SECRET_KEY="wenlwkU1AYwNBf7Q9cCoG4VT_GYyrHE9AS_R2u81"
-export QINIU_PIC_KEY="hello_jpg"
-export QINIU_NOEXIST_PIC_KEY="no_exist"
-export QINIU_BUCKET_NAME="pysdk"
-export QINIU_DOMAIN="pysdk.qiniudn.com"
@@ -7,11 +7,11 @@
import qiniu.conf
pic = "http://cheneya.qiniudn.com/hello_jpg"
+key = 'QINIU_UNIT_TEST_PIC'
def setUp():
qiniu.conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
qiniu.conf.SECRET_KEY = os.getenv("QINIU_SECRET_KEY")
- key = os.getenv("QINIU_PIC_KEY")
bucket_name = os.getenv("QINIU_BUCKET_NAME")
policy = qiniu.rs.PutPolicy(bucket_name)
@@ -13,9 +13,9 @@ def r(length):
conf.ACCESS_KEY = os.getenv("QINIU_ACCESS_KEY")
conf.SECRET_KEY = os.getenv("QINIU_SECRET_KEY")
-key = os.getenv("QINIU_PIC_KEY")
+key = 'QINIU_UNIT_TEST_PIC'
bucket_name = os.getenv("QINIU_BUCKET_NAME")
-noexist_key = os.getenv("QINIU_NOEXIST_PIC_KEY")
+noexist_key = 'QINIU_UNIT_TEST_NOEXIST' + r(30)
key2 = "rs_demo_test_key_1_" + r(5)
key3 = "rs_demo_test_key_2_" + r(5)
key4 = "rs_demo_test_key_3_" + r(5)
@@ -16,7 +16,7 @@
conf.SECRET_KEY = os.getenv("QINIU_SECRET_KEY")
bucket_name = os.getenv("QINIU_BUCKET_NAME")
domain = os.getenv("QINIU_DOMAIN")
-key = os.getenv("QINIU_PIC_KEY")
+key = 'QINIU_UNIT_TEST_PIC'
class TestToken(unittest.TestCase):
def test_put_policy(self):
View
@@ -0,0 +1,4 @@
+export QINIU_ACCESS_KEY="<access_key>"
+export QINIU_SECRET_KEY="<secret_key>"
+export QINIU_BUCKET_NAME="<bucket_name>"
+export QINIU_DOMAIN="<bucket_domain>"

0 comments on commit fa0b457

Please sign in to comment.