MCPcopy Create free account
hub / github.com/crashappsec/github-analyzer / TestSampleOrg

Function TestSampleOrg

pkg/github/auditor/auditor_test.go:37–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestSampleOrg(t *testing.T) {
38 auditor := &GithubAuditor{client: client}
39 ctx := context.Background()
40 back := &backoff.Backoff{
41 Min: 30 * time.Second,
42 Max: 3 * time.Minute,
43 Jitter: true,
44 }
45
46 name := os.Getenv("GH_SECURITY_AUDITOR_ORGANIZATION")
47 if name == "" {
48 name = "github-security-auditor-test-org"
49 }
50
51 org, err := org.NewOrganization(ctx, auditor.client, back, name)
52
53 assert.Nil(t, err, "Could not create organization")
54 assert.NotNil(t, org.CoreStats, "Could not fetch core stats")
55 assert.Equal(t, name, *org.CoreStats.Login)
56 assert.GreaterOrEqual(t, 1, *org.CoreStats.TotalPrivateRepos)
57 assert.NotNil(
58 t,
59 org.CoreStats.TwoFactorRequirementEnabled,
60 "nil two factor auth",
61 )
62}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected