github.com/scaleway/scaleway-cli@v1.11.1/pkg/config/config_test.go (about) 1 // Copyright (C) 2015 Scaleway. All rights reserved. 2 // Use of this source code is governed by a MIT-style 3 // license that can be found in the LICENSE.md file. 4 5 package config 6 7 import ( 8 "strings" 9 "testing" 10 11 . "github.com/smartystreets/goconvey/convey" 12 ) 13 14 func TestGetConfigFilePath(t *testing.T) { 15 Convey("Testing GetConfigFilePath()", t, func() { 16 configPath, err := GetConfigFilePath() 17 So(err, ShouldBeNil) 18 So(configPath, ShouldNotEqual, "") 19 20 homedir, err := GetHomeDir() 21 So(err, ShouldBeNil) 22 So(strings.Contains(configPath, homedir), ShouldBeTrue) 23 }) 24 } 25 26 func TestGetHomeDir(t *testing.T) { 27 Convey("Testing GetHomeDir()", t, func() { 28 homedir, err := GetHomeDir() 29 So(err, ShouldBeNil) 30 So(homedir, ShouldNotEqual, "") 31 }) 32 }