Check the key paths too

This commit is contained in:
Caleb Brose 2022-06-29 10:51:17 -05:00
parent 19b5400811
commit c5b07762d1

View file

@ -5,6 +5,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"github.com/cli/cli/v2/internal/codespaces/api"
@ -87,6 +88,12 @@ func TestAutomaticSSHKeyPairs(t *testing.T) {
if keyPair == nil {
t.Error("Unexpected nil KeyPair from setupAutomaticSSHKeys")
}
if !strings.HasSuffix(keyPair.PrivateKeyPath, automaticPrivateKeyName) {
t.Errorf("Expected private key path %v, got %v", automaticPrivateKeyName, keyPair.PrivateKeyPath)
}
if !strings.HasSuffix(keyPair.PublicKeyPath, automaticPrivateKeyName+".pub") {
t.Errorf("Expected public key path %v, got %v", automaticPrivateKeyName+".pub", keyPair.PublicKeyPath)
}
// Check that all the expected files are present
for _, file := range tt.wantFinalFiles {