-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding git remotes to subjects and normalising url
Signed-off-by: chaosinthecrd <[email protected]>
- Loading branch information
1 parent
80f9b23
commit ef9a096
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,25 @@ func TestNameTypeRunType(t *testing.T) { | |
require.Equal(t, RunType, attestor.RunType(), "Expected the attestor's run type") | ||
} | ||
|
||
func TestNormaliseRemotes(t *testing.T) { | ||
remotes := []string{ | ||
"github.com/in-toto/go-witness", | ||
"github.com/in-toto/go-witness.git", | ||
"https://github.com/in-toto/go-witness", | ||
"https://github.com/in-toto/go-witness.git", | ||
"[email protected]:in-toto/go-witness", | ||
"[email protected]:in-toto/go-witness.git", | ||
} | ||
|
||
for _, r := range remotes { | ||
nr, err := normaliseRemoteURL(r) | ||
require.NoError(t, err, "Expected no error from normaliseRemoteURL") | ||
|
||
require.Equal(t, "github.com/in-toto/go-witness", nr, "normalising failed for %s. Expected 'github.com/in-toto/go-witness', got %s", r, nr) | ||
} | ||
|
||
} | ||
|
||
func TestRunWorksWithCommits(t *testing.T) { | ||
attestor := New() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters