(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected