File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ before_script:
13
13
- export QINIU_SECRET_KEY="wenlwkU1AYwNBf7Q9cCoG4VT_GYyrHE9AS_R2u81"
14
14
- export QINIU_TEST_BUCKET="pysdk"
15
15
- export QINIU_TEST_DOMAIN="pysdk.qiniudn.com"
16
+ - export QINIU_TEST_ENV="travis"
16
17
- export PYTHONPATH="$PYTHONPATH:."
17
18
script :
18
19
- python setup.py nosetests
Original file line number Diff line number Diff line change 21
21
bucket = os .getenv ("QINIU_TEST_BUCKET" )
22
22
conf .ACCESS_KEY = os .getenv ("QINIU_ACCESS_KEY" )
23
23
conf .SECRET_KEY = os .getenv ("QINIU_SECRET_KEY" )
24
+ test_env = os .getenv ("QINIU_TEST_ENV" )
25
+ is_travis = test_env == "travis"
24
26
25
27
26
28
def r (length ):
@@ -31,6 +33,8 @@ def r(length):
31
33
class TestBlock (unittest .TestCase ):
32
34
33
35
def test_block (self ):
36
+ if is_travis :
37
+ return
34
38
policy = rs .PutPolicy (bucket )
35
39
uptoken = policy .token ()
36
40
client = up .Client (uptoken )
@@ -57,6 +61,8 @@ def test_block(self):
57
61
rs .Client ().delete (bucket , key )
58
62
59
63
def test_put (self ):
64
+ if is_travis :
65
+ return
60
66
src = urllib .urlopen ("http://cheneya.qiniudn.com/hello_jpg" )
61
67
ostype = platform .system ()
62
68
if ostype .lower ().find ("windows" ) != - 1 :
@@ -84,6 +90,8 @@ def test_put(self):
84
90
rs .Client ().delete (bucket , key )
85
91
86
92
def test_put_4m (self ):
93
+ if is_travis :
94
+ return
87
95
ostype = platform .system ()
88
96
if ostype .lower ().find ("windows" ) != - 1 :
89
97
tmpf = "" .join ([os .getcwd (), os .tmpnam ()])
@@ -111,4 +119,5 @@ def test_put_4m(self):
111
119
112
120
113
121
if __name__ == "__main__" :
114
- unittest .main ()
122
+ if not is_travis :
123
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments