* Test the Python language host end-to-end This commit introduces an end-to-end language host testing framework for the Python SDK, similar to what already exists for the Node SDK. The real language host is used to run Pulumi programs written in Python while mocking out the resource monitor. * Add new tests * Print out better diagnostics when the langhost fails to launch * Use the in-tree executor for testing * CR: Place tests and code being tested in the same directory for ease of understanding, add a README * Turns out I misunderstood the semantics of resource registration - fix two tests so that they pass now and fix a few bugs in the test harness
22 lines
825 B
Python
22 lines
825 B
Python
# Copyright 2016-2018, Pulumi Corporation.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
from pulumi import CustomResource, Config
|
|
|
|
|
|
class MyResource(CustomResource):
|
|
def __init__(self, name):
|
|
CustomResource.__init__(self, "test:index:MyResource", name)
|
|
|
|
config = Config("foo")
|
|
MyResource(config.require("name"))
|