Documentation
¶
Overview ¶
Package ghtest is an in-memory fake of the parts of the GitHub REST API triage uses, for tests.
Index ¶
- type Server
- func (s *Server) AddIssue(repoName string, title, body string, labels ...string) gh.Issue
- func (s *Server) AddRepo(name string)
- func (s *Server) Client() *gh.Client
- func (s *Server) Comments(repoName string, number int) []gh.Comment
- func (s *Server) EditIssue(repoName string, number int, edit func(*gh.Issue))
- func (s *Server) HideFromListing(repoName string, number int, hidden bool)
- func (s *Server) Issue(repoName string, number int) gh.Issue
- func (s *Server) IssueCount(repoName string) int
- func (s *Server) LabelNames(repoName string, number int) []string
- func (s *Server) RepoLabel(repoName, name string) (gh.Label, bool)
- func (s *Server) SetOffline(offline bool)
- func (s *Server) SetReadOnly(name string, readOnly bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
*httptest.Server
Login string
Requests []string
// contains filtered or unexported fields
}
Server is a fake GitHub.
func (*Server) HideFromListing ¶
HideFromListing makes an issue missing from issue listings, as GitHub's eventually consistent listing sometimes does for new issues.
func (*Server) IssueCount ¶
IssueCount returns how many issues a repo has.
func (*Server) LabelNames ¶
LabelNames returns the names of an issue's labels.
func (*Server) SetOffline ¶
SetOffline makes every request fail with a network error.
func (*Server) SetReadOnly ¶
SetReadOnly makes writes to repo fail with 403.
Click to show internal directories.
Click to hide internal directories.