@@ -20,19 +20,22 @@ JtdGRlLmNzYgECAw==
2020func TestGetClientOptions_HTTPToken (t * testing.T ) {
2121 m := & managerImpl {}
2222 secret := map [string ][]byte {"token" : []byte ("my-token" )}
23- opts , err := m .getClientOptions ("https" , secret )
23+ opts , tmpFile , err := m .getClientOptions ("https" , secret )
2424 if err != nil {
2525 t .Fatalf ("unexpected error: %v" , err )
2626 }
2727 if len (opts ) != 1 {
2828 t .Fatalf ("expected 1 option, got %d" , len (opts ))
2929 }
30+ if tmpFile != "" {
31+ t .Fatalf ("expected no temp file, got %s" , tmpFile )
32+ }
3033}
3134
3235func TestGetClientOptions_HTTPUsernamePassword (t * testing.T ) {
3336 m := & managerImpl {}
3437 secret := map [string ][]byte {"username" : []byte ("user" ), "password" : []byte ("pass" )}
35- opts , err := m .getClientOptions ("http" , secret )
38+ opts , _ , err := m .getClientOptions ("http" , secret )
3639 if err != nil {
3740 t .Fatalf ("unexpected error: %v" , err )
3841 }
@@ -43,7 +46,7 @@ func TestGetClientOptions_HTTPUsernamePassword(t *testing.T) {
4346
4447func TestGetClientOptions_HTTPEmpty (t * testing.T ) {
4548 m := & managerImpl {}
46- opts , err := m .getClientOptions ("https" , nil )
49+ opts , _ , err := m .getClientOptions ("https" , nil )
4750 if err != nil {
4851 t .Fatalf ("unexpected error: %v" , err )
4952 }
@@ -54,7 +57,7 @@ func TestGetClientOptions_HTTPEmpty(t *testing.T) {
5457
5558func TestGetClientOptions_SSHNoSecret (t * testing.T ) {
5659 m := & managerImpl {}
57- opts , err := m .getClientOptions (sshScheme , nil )
60+ opts , _ , err := m .getClientOptions (sshScheme , nil )
5861 if err != nil {
5962 t .Fatalf ("unexpected error: %v" , err )
6063 }
@@ -65,7 +68,7 @@ func TestGetClientOptions_SSHNoSecret(t *testing.T) {
6568
6669func TestGetClientOptions_SSHEmptySecret (t * testing.T ) {
6770 m := & managerImpl {}
68- opts , err := m .getClientOptions (sshScheme , map [string ][]byte {})
71+ opts , _ , err := m .getClientOptions (sshScheme , map [string ][]byte {})
6972 if err != nil {
7073 t .Fatalf ("unexpected error: %v" , err )
7174 }
@@ -77,7 +80,7 @@ func TestGetClientOptions_SSHEmptySecret(t *testing.T) {
7780func TestGetClientOptions_SSHWithPrivateKey (t * testing.T ) {
7881 m := & managerImpl {}
7982 secret := map [string ][]byte {"sshPrivateKey" : []byte (testEd25519PrivateKey )}
80- opts , err := m .getClientOptions (sshScheme , secret )
83+ opts , _ , err := m .getClientOptions (sshScheme , secret )
8184 if err != nil {
8285 t .Fatalf ("unexpected error: %v" , err )
8386 }
@@ -89,7 +92,7 @@ func TestGetClientOptions_SSHWithPrivateKey(t *testing.T) {
8992func TestGetClientOptions_SSHWithInvalidKey (t * testing.T ) {
9093 m := & managerImpl {}
9194 secret := map [string ][]byte {"sshPrivateKey" : []byte ("not-a-valid-key" )}
92- _ , err := m .getClientOptions (sshScheme , secret )
95+ _ , _ , err := m .getClientOptions (sshScheme , secret )
9396 if err == nil {
9497 t .Fatal ("expected error for invalid SSH key, got nil" )
9598 }
0 commit comments