MCPcopy Create free account
hub / github.com/ejoffe/spr / TestGitHubRemoteSource

Function TestGitHubRemoteSource

config/config_parser/config_parser_test.go:66–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestGitHubRemoteSource(t *testing.T) {
67 mock := mockgit.NewMockGit(t)
68 mock.ExpectRemote("https://github.com/r2/d2.git")
69
70 expect := config.Config{
71 Repo: &config.RepoConfig{
72 GitHubRepoOwner: "r2",
73 GitHubRepoName: "d2",
74 GitHubHost: "github.com",
75 RequireChecks: false,
76 RequireApproval: false,
77 MergeMethod: "",
78 },
79 User: &config.UserConfig{
80 ShowPRLink: false,
81 LogGitCommands: false,
82 LogGitHubCalls: false,
83 StatusBitsHeader: false,
84 },
85 }
86
87 actual := config.Config{
88 Repo: &config.RepoConfig{},
89 User: &config.UserConfig{},
90 }
91 source := NewGitHubRemoteSource(&actual, mock)
92 source.Load(nil)
93 assert.Equal(t, expect, actual)
94 mock.ExpectationsMet()
95}

Callers

nothing calls this directly

Calls 5

NewMockGitFunction · 0.92
NewGitHubRemoteSourceFunction · 0.85
ExpectRemoteMethod · 0.80
LoadMethod · 0.45
ExpectationsMetMethod · 0.45

Tested by

no test coverage detected