|
|
@ -1,4 +1,4 @@ |
|
|
// Copyright 2013 The go-github AUTHORS. All rights reserved.
|
|
|
|
|
|
|
|
|
// Copyright 2014 The go-github AUTHORS. All rights reserved.
|
|
|
//
|
|
|
//
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
// license that can be found in the LICENSE file.
|
|
|
// license that can be found in the LICENSE file.
|
|
|
@ -101,3 +101,53 @@ func TestRepositoriesService_ListCommitActivity(t *testing.T) { |
|
|
t.Errorf("RepositoriesService.ListCommitActivity returned %+v, want %+v", activity, want) |
|
|
t.Errorf("RepositoriesService.ListCommitActivity returned %+v, want %+v", activity, want) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestRepositoriesService_Participation(t *testing.T) { |
|
|
|
|
|
setup() |
|
|
|
|
|
defer teardown() |
|
|
|
|
|
|
|
|
|
|
|
mux.HandleFunc("/repos/o/r/stats/participation", func(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
|
testMethod(t, r, "GET") |
|
|
|
|
|
|
|
|
|
|
|
fmt.Fprint(w, ` |
|
|
|
|
|
{ |
|
|
|
|
|
"all": [ |
|
|
|
|
|
11,21,15,2,8,1,8,23,17,21,11,10,33, |
|
|
|
|
|
91,38,34,22,23,32,3,43,87,71,18,13,5, |
|
|
|
|
|
13,16,66,27,12,45,110,117,13,8,18,9,19, |
|
|
|
|
|
26,39,12,20,31,46,91,45,10,24,9,29,7 |
|
|
|
|
|
], |
|
|
|
|
|
"owner": [ |
|
|
|
|
|
3,2,3,0,2,0,5,14,7,9,1,5,0, |
|
|
|
|
|
48,19,2,0,1,10,2,23,40,35,8,8,2, |
|
|
|
|
|
10,6,30,0,2,9,53,104,3,3,10,4,7, |
|
|
|
|
|
11,21,4,4,22,26,63,11,2,14,1,10,3 |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
`) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
participation, _, err := client.Repositories.ListParticipation("o", "r") |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
t.Errorf("RepositoriesService.ListParticipation returned error: %v", err) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
want := &RepositoryParticipation{ |
|
|
|
|
|
All: []int{ |
|
|
|
|
|
11, 21, 15, 2, 8, 1, 8, 23, 17, 21, 11, 10, 33, |
|
|
|
|
|
91, 38, 34, 22, 23, 32, 3, 43, 87, 71, 18, 13, 5, |
|
|
|
|
|
13, 16, 66, 27, 12, 45, 110, 117, 13, 8, 18, 9, 19, |
|
|
|
|
|
26, 39, 12, 20, 31, 46, 91, 45, 10, 24, 9, 29, 7, |
|
|
|
|
|
}, |
|
|
|
|
|
Owner: []int{ |
|
|
|
|
|
3, 2, 3, 0, 2, 0, 5, 14, 7, 9, 1, 5, 0, |
|
|
|
|
|
48, 19, 2, 0, 1, 10, 2, 23, 40, 35, 8, 8, 2, |
|
|
|
|
|
10, 6, 30, 0, 2, 9, 53, 104, 3, 3, 10, 4, 7, |
|
|
|
|
|
11, 21, 4, 4, 22, 26, 63, 11, 2, 14, 1, 10, 3, |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(participation, want) { |
|
|
|
|
|
t.Errorf("RepositoriesService.ListParticipation returned %+v, want %+v", participation, want) |
|
|
|
|
|
} |
|
|
|
|
|
} |