(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestGetOrgAndRepo(t *testing.T) { |
| 13 | t.Run("with valid source URL", func(t *testing.T) { |
| 14 | sourceURL := "https://github.com/github/gh-attestation" |
| 15 | org, repo, err := getOrgAndRepo("", sourceURL) |
| 16 | require.Nil(t, err) |
| 17 | require.Equal(t, "github", org) |
| 18 | require.Equal(t, "gh-attestation", repo) |
| 19 | }) |
| 20 | |
| 21 | t.Run("with invalid source URL", func(t *testing.T) { |
| 22 | sourceURL := "hub.com/github/gh-attestation" |
| 23 | org, repo, err := getOrgAndRepo("", sourceURL) |
| 24 | require.Error(t, err) |
| 25 | require.Zero(t, org) |
| 26 | require.Zero(t, repo) |
| 27 | }) |
| 28 | |
| 29 | t.Run("with valid source tenant URL", func(t *testing.T) { |
| 30 | sourceURL := "https://foo.ghe.com/github/gh-attestation" |
| 31 | org, repo, err := getOrgAndRepo("foo", sourceURL) |
| 32 | require.Nil(t, err) |
| 33 | require.Equal(t, "github", org) |
| 34 | require.Equal(t, "gh-attestation", repo) |
| 35 | }) |
| 36 | } |
| 37 | |
| 38 | func TestGetAttestationDetail(t *testing.T) { |
| 39 | bundlePath := test.NormalizeRelativePath("../test/data/sigstore-js-2.1.0-bundle.json") |
nothing calls this directly
no test coverage detected
searching dependent graphs…