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

Function TestCredentialPatternFromGitURL

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

Source from the content-addressed store, hash-verified

1643}
1644
1645func TestCredentialPatternFromGitURL(t *testing.T) {
1646 // Given a well-formed HTTPS Git URL
1647 gitURL := "https://github.com/OWNER/REPO.git"
1648
1649 // When its credential scope is derived
1650 credentialPattern, err := CredentialPatternFromGitURL(gitURL)
1651
1652 // Then credentials are scoped to the URL's HTTPS host
1653 require.NoError(t, err)
1654 assert.Equal(t, CredentialPattern{pattern: "https://github.com"}, credentialPattern)
1655}
1656
1657func TestCredentialPatternFromGitURLReportsMalformedURL(t *testing.T) {
1658 // Given a Git URL with a malformed bracketed host

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.80

Tested by

no test coverage detected