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

Function TestClientRemoteURLReturnsConfiguredURL

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

Source from the content-addressed store, hash-verified

1740}
1741
1742func TestClientRemoteURLReturnsConfiguredURL(t *testing.T) {
1743 // Given a repository with a configured remote
1744 repo := newTestRepo(t)
1745 repo.run(t, "remote", "add", "origin", "https://github.com/monalisa/skills-repo.git")
1746
1747 // When the remote URL is requested
1748 remoteURL, err := repo.client.RemoteURL(t.Context(), "origin")
1749
1750 // Then the configured URL is returned
1751 require.NoError(t, err)
1752 assert.Equal(t, "https://github.com/monalisa/skills-repo.git", remoteURL)
1753}
1754
1755func TestClientRemoteURLReportsMissingRemote(t *testing.T) {
1756 // Given a repository without the requested remote

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
RemoteURLMethod · 0.80
EqualMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected