Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Aug 7, 2019
1 parent d077945 commit 4c0b9a6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/examples/python/get/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: get
description: A program that smoke-tests .get support
runtime: python
17 changes: 17 additions & 0 deletions tests/examples/python/get/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2016-2019, 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_kubernetes.core.v1 import Service

service = Service.get("kube-api", "kubernetes")
1 change: 1 addition & 0 deletions tests/examples/python/get/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pulumi>=0.17.1,<0.18.0
17 changes: 17 additions & 0 deletions tests/examples/python/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ func TestSmoke(t *testing.T) {
integration.ProgramTest(t, &options)
}

// Smoke test for .get support.
func TestGet(t *testing.T) {
kubectx := os.Getenv("KUBERNETES_CONTEXT")
if kubectx == "" {
t.Skipf("Skipping test due to missing KUBERNETES_CONTEXT variable")
}

cwd, err := os.Getwd()
if !assert.NoError(t, err) {
t.FailNow()
}
options := baseOptions.With(integration.ProgramTestOptions{
Dir: filepath.Join(cwd, "get"),
})
integration.ProgramTest(t, &options)
}

func TestYaml(t *testing.T) {
kubectx := os.Getenv("KUBERNETES_CONTEXT")
if kubectx == "" {
Expand Down

0 comments on commit 4c0b9a6

Please sign in to comment.