pulumi/tests/integration/stack_reference/python/step2/__main__.py
Lee Zen f6402882c2
Regression tests for StackReference in the Python SDK (#3913)
* Make Python StackReference test similar to others (with two steps)
* Include new Python StackReference integration test that uses multiple stacks
* Expose various life cycle methods for ProgramTester
2020-02-17 10:40:46 -08:00

18 lines
412 B
Python

# Copyright 2020, Pulumi Corporation. All rights reserved.
import pulumi
config = pulumi.Config()
org = config.require('org')
slug = f"{org}/{pulumi.get_project()}/{pulumi.get_stack()}"
a = pulumi.StackReference(slug)
got_err = False
try:
a.get_output('val2')
except Exception:
got_err = True
if not got_err:
raise Exception('Expected to get error trying to read secret from stack reference.')