MCPcopy Index your code
hub / github.com/google/go-github / TestIssuesService_Lock

Function TestIssuesService_Lock

github/issues_test.go:431–455  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

429}
430
431func TestIssuesService_Lock(t *testing.T) {
432 t.Parallel()
433 client, mux, _ := setup(t)
434
435 mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) {
436 testMethod(t, r, "PUT")
437
438 w.WriteHeader(http.StatusNoContent)
439 })
440
441 ctx := t.Context()
442 if _, err := client.Issues.Lock(ctx, "o", "r", 1, nil); err != nil {
443 t.Errorf("Issues.Lock returned error: %v", err)
444 }
445
446 const methodName = "Lock"
447 testBadOptions(t, methodName, func() (err error) {
448 _, err = client.Issues.Lock(ctx, "\n", "\n", -1, nil)
449 return err
450 })
451
452 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
453 return client.Issues.Lock(ctx, "o", "r", 1, nil)
454 })
455}
456
457func TestIssuesService_LockWithReason(t *testing.T) {
458 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
testBadOptionsFunction · 0.85
LockMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…