(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func Test_getExtensionRepos(t *testing.T) { |
| 69 | reg := httpmock.Registry{} |
| 70 | defer reg.Verify(t) |
| 71 | |
| 72 | client := &http.Client{Transport: ®} |
| 73 | |
| 74 | values := url.Values{ |
| 75 | "page": []string{"1"}, |
| 76 | "per_page": []string{"100"}, |
| 77 | "q": []string{"topic:gh-extension"}, |
| 78 | } |
| 79 | cfg := config.NewBlankConfig() |
| 80 | |
| 81 | cfg.AuthenticationFunc = func() gh.AuthConfig { |
| 82 | authCfg := &config.AuthConfig{} |
| 83 | authCfg.SetDefaultHost("github.com", "") |
| 84 | return authCfg |
| 85 | } |
| 86 | |
| 87 | reg.Register( |
| 88 | httpmock.QueryMatcher("GET", "search/repositories", values), |
| 89 | httpmock.JSONResponse(map[string]interface{}{ |
| 90 | "incomplete_results": false, |
| 91 | "total_count": 4, |
| 92 | "items": []interface{}{ |
| 93 | map[string]interface{}{ |
| 94 | "name": "gh-screensaver", |
| 95 | "full_name": "vilmibm/gh-screensaver", |
| 96 | "description": "terminal animations", |
| 97 | "owner": map[string]interface{}{ |
| 98 | "login": "vilmibm", |
| 99 | }, |
| 100 | }, |
| 101 | map[string]interface{}{ |
| 102 | "name": "gh-cool", |
| 103 | "full_name": "cli/gh-cool", |
| 104 | "description": "it's just cool ok", |
| 105 | "owner": map[string]interface{}{ |
| 106 | "login": "cli", |
| 107 | }, |
| 108 | }, |
| 109 | map[string]interface{}{ |
| 110 | "name": "gh-triage", |
| 111 | "full_name": "samcoe/gh-triage", |
| 112 | "description": "helps with triage", |
| 113 | "owner": map[string]interface{}{ |
| 114 | "login": "samcoe", |
| 115 | }, |
| 116 | }, |
| 117 | map[string]interface{}{ |
| 118 | "name": "gh-gei", |
| 119 | "full_name": "github/gh-gei", |
| 120 | "description": "something something enterprise", |
| 121 | "owner": map[string]interface{}{ |
| 122 | "login": "github", |
| 123 | }, |
| 124 | }, |
| 125 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…