@@ -662,6 +662,8 @@ func TestRunCommand_environment(t *testing.T) {
662662 rootDirUUID := uuid .New ()
663663 secretUUID := uuid .New ()
664664
665+ const secretPathFoo = "namespace/repo/foo"
666+
665667 cases := map [string ]struct {
666668 command RunCommand
667669 expectedEnv []string
@@ -806,7 +808,7 @@ func TestRunCommand_environment(t *testing.T) {
806808 SecretService : & fakeclient.SecretService {
807809 VersionService : & fakeclient.SecretVersionService {
808810 GetWithDataFunc : func (path string ) (* api.SecretVersion , error ) {
809- if path == "namespace/repo/foo" {
811+ if path == secretPathFoo {
810812 return & api.SecretVersion {Data : []byte ("aaa" )}, nil
811813 } else if path == "other/secret/path" {
812814 return & api.SecretVersion {Data : []byte ("bbb" )}, nil
@@ -857,7 +859,7 @@ func TestRunCommand_environment(t *testing.T) {
857859 SecretService : & fakeclient.SecretService {
858860 VersionService : & fakeclient.SecretVersionService {
859861 GetWithDataFunc : func (path string ) (* api.SecretVersion , error ) {
860- if path == "namespace/repo/foo" {
862+ if path == secretPathFoo {
861863 return & api.SecretVersion {Data : []byte ("aaa" )}, nil
862864 }
863865 return nil , api .ErrSecretNotFound
@@ -909,7 +911,7 @@ func TestRunCommand_environment(t *testing.T) {
909911 GetWithDataFunc : func (path string ) (* api.SecretVersion , error ) {
910912 if path == "test/test/test" {
911913 return & api.SecretVersion {Data : []byte ("bbb" )}, nil
912- } else if path == "namespace/repo/foo" {
914+ } else if path == secretPathFoo {
913915 return & api.SecretVersion {Data : []byte ("aaa" )}, nil
914916 }
915917 return nil , api .ErrSecretNotFound
0 commit comments