File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ import os
15
16
import random
16
17
import string
17
18
21
22
22
23
import export
23
24
25
+ BUCKET = os .environ ['CLOUD_STORAGE_BUCKET' ]
24
26
TEST_SINK_NAME_TMPL = 'example_sink_{}'
25
27
TEST_SINK_FILTER = 'severity>=CRITICAL'
26
28
@@ -32,14 +34,13 @@ def _random_id():
32
34
33
35
34
36
@pytest .yield_fixture
35
- def example_sink (cloud_config ):
37
+ def example_sink ():
36
38
client = logging .Client ()
37
39
38
40
sink = client .sink (
39
41
TEST_SINK_NAME_TMPL .format (_random_id ()),
40
42
TEST_SINK_FILTER ,
41
- 'storage.googleapis.com/{bucket}' .format (
42
- bucket = cloud_config .storage_bucket ))
43
+ 'storage.googleapis.com/{bucket}' .format (bucket = BUCKET ))
43
44
44
45
sink .create ()
45
46
@@ -59,13 +60,13 @@ def _():
59
60
assert example_sink .name in out
60
61
61
62
62
- def test_create (cloud_config , capsys ):
63
+ def test_create (capsys ):
63
64
sink_name = TEST_SINK_NAME_TMPL .format (_random_id ())
64
65
65
66
try :
66
67
export .create_sink (
67
68
sink_name ,
68
- cloud_config . storage_bucket ,
69
+ BUCKET ,
69
70
TEST_SINK_FILTER )
70
71
# Clean-up the temporary sink.
71
72
finally :
You can’t perform that action at this time.
0 commit comments