github.com/stefanmcshane/helm@v0.0.0-20221213002717-88a4a2c6e77d/cmd/helm/get_notes_test.go (about) 1 /* 2 Copyright The Helm Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package main 18 19 import ( 20 "testing" 21 22 "github.com/stefanmcshane/helm/pkg/release" 23 ) 24 25 func TestGetNotesCmd(t *testing.T) { 26 tests := []cmdTestCase{{ 27 name: "get notes of a deployed release", 28 cmd: "get notes the-limerick", 29 golden: "output/get-notes.txt", 30 rels: []*release.Release{release.Mock(&release.MockReleaseOptions{Name: "the-limerick"})}, 31 }, { 32 name: "get notes without args", 33 cmd: "get notes", 34 golden: "output/get-notes-no-args.txt", 35 wantError: true, 36 }} 37 runTestCmd(t, tests) 38 } 39 40 func TestGetNotesCompletion(t *testing.T) { 41 checkReleaseCompletion(t, "get notes", false) 42 } 43 44 func TestGetNotesRevisionCompletion(t *testing.T) { 45 revisionFlagCompletionTest(t, "get notes") 46 } 47 48 func TestGetNotesFileCompletion(t *testing.T) { 49 checkFileCompletion(t, "get notes", false) 50 checkFileCompletion(t, "get notes myrelease", false) 51 }