StubUpload registers one upload of name against repositoryID, answering with status and body. It matches on the query the upload carries, so a request that names the wrong repository or the wrong file matches nothing and the test fails.
(reg *httpmock.Registry, repositoryID int64, name string, status int, body string)
| 65 | // It matches on the query the upload carries, so a request that names the wrong |
| 66 | // repository or the wrong file matches nothing and the test fails. |
| 67 | func StubUpload(reg *httpmock.Registry, repositoryID int64, name string, status int, body string) { |
| 68 | reg.Register(uploadMatcher(repositoryID, name), httpmock.StatusStringResponse(status, body)) |
| 69 | } |
| 70 | |
| 71 | // StubUploadToHost is StubUpload plus the host the request reached. The |
| 72 | // matchers compare the path only, so the host is asserted in the responder or |