MCPcopy Create free account
hub / github.com/cli/cli / TestCredentialPatternFromHost

Function TestCredentialPatternFromHost

git/client_test.go:2081–2102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2079}
2080
2081func TestCredentialPatternFromHost(t *testing.T) {
2082 tests := []struct {
2083 name string
2084 host string
2085 wantCredentialPattern CredentialPattern
2086 }{
2087 {
2088 name: "Given a well formed host, it returns the corresponding CredentialPattern",
2089 host: "github.com",
2090 wantCredentialPattern: CredentialPattern{
2091 pattern: "https://github.com",
2092 allMatching: false,
2093 },
2094 },
2095 }
2096 for _, tt := range tests {
2097 t.Run(tt.name, func(t *testing.T) {
2098 credentialPattern := CredentialPatternFromHost(tt.host)
2099 require.Equal(t, tt.wantCredentialPattern, credentialPattern)
2100 })
2101 }
2102}
2103
2104func TestPushDefault(t *testing.T) {
2105 t.Run("it parses valid values correctly", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected