aboutsummaryrefslogtreecommitdiffstats
path: root/common_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-12-01 09:59:19 +0100
committerGitHub <noreply@github.com>2016-12-01 09:59:19 +0100
commitc15bf1dff332873644290db0e186b8f5ad9b8fb2 (patch)
tree1dd79212333823b70f2792ad116864ea127e4a1c /common_test.go
parent7de79aef5d4aa3100382d4df3e99525f9949e8d1 (diff)
downloadgo-git-c15bf1dff332873644290db0e186b8f5ad9b8fb2.tar.gz
capabilities: full integration (#151)
* format/pktline: fix readPayloadLen err handling * protocol/pakp: UploadReq validation and creation of capabilities * protocol/pakp: AdvRef tests * protocol/pakp: capability.List.Delete * protocol: filter unsupported capabilities * remote capability negociation * transport: UploadRequest validation * requested changes
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/common_test.go b/common_test.go
index 1e90409..3aa3693 100644
--- a/common_test.go
+++ b/common_test.go
@@ -119,6 +119,13 @@ func (c *MockFetchPackSession) AdvertisedReferences() (*packp.AdvRefs, error) {
func (c *MockFetchPackSession) FetchPack(
r *packp.UploadPackRequest) (io.ReadCloser, error) {
+ if !r.Capabilities.Supports(capability.Agent) {
+ return nil, fmt.Errorf("" +
+ "invalid test rquest, missing Agent capability, the request" +
+ "should be created using NewUploadPackRequestFromCapabilities",
+ )
+ }
+
f := fixtures.ByURL(c.endpoint.String())
if len(r.Wants) == 1 {