github.com/darkowlzz/helm@v2.5.1-0.20171213183701-6707fe0468d4+incompatible/pkg/helm/helmpath/helmhome_windows_test.go (about) 1 // Copyright 2016 The Kubernetes Authors All rights reserved. 2 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // you may not use this file except in compliance with the License. 4 // You may obtain a copy of the License at 5 6 // http://www.apache.org/licenses/LICENSE-2.0 7 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 // +build windows 15 16 package helmpath 17 18 import ( 19 "testing" 20 ) 21 22 func TestHelmHome(t *testing.T) { 23 hh := Home("r:\\") 24 isEq := func(t *testing.T, a, b string) { 25 if a != b { 26 t.Errorf("Expected %q, got %q", b, a) 27 } 28 } 29 30 isEq(t, hh.String(), "r:\\") 31 isEq(t, hh.Repository(), "r:\\repository") 32 isEq(t, hh.RepositoryFile(), "r:\\repository\\repositories.yaml") 33 isEq(t, hh.LocalRepository(), "r:\\repository\\local") 34 isEq(t, hh.Cache(), "r:\\repository\\cache") 35 isEq(t, hh.CacheIndex("t"), "r:\\repository\\cache\\t-index.yaml") 36 isEq(t, hh.Starters(), "r:\\starters") 37 isEq(t, hh.Archive(), "r:\\cache\\archive") 38 isEq(t, hh.TLSCaCert(), "r:\\ca.pem") 39 isEq(t, hh.TLSCert(), "r:\\cert.pem") 40 isEq(t, hh.TLSKey(), "r:\\key.pem") 41 }