mirror of
https://github.com/goharbor/harbor
synced 2025-04-22 19:10:40 +00:00
add testing code, fix issue.
This commit is contained in:
parent
7bb67cf6ce
commit
5a919bec50
@ -532,16 +532,16 @@ func TestAccessLog(t *testing.T) {
|
||||
|
||||
func TestGetAccessLogCreator(t *testing.T) {
|
||||
var err error
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/ubuntu", repoTag2, "push")
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/tomcat", repoTag2, "push")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||
}
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/ubuntu", repoTag2, "push")
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/tomcat", repoTag2, "push")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||
}
|
||||
|
||||
user, err := GetAccessLogCreator(currentProject.Name + "/ubuntu")
|
||||
user, err := GetAccessLogCreator(currentProject.Name + "/tomcat")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in GetAccessLogCreator: %v", err)
|
||||
}
|
||||
@ -552,20 +552,20 @@ func TestGetAccessLogCreator(t *testing.T) {
|
||||
|
||||
func TestCountPull(t *testing.T) {
|
||||
var err error
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/ubuntu", repoTag2, "pull")
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/tomcat", repoTag2, "pull")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||
}
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/ubuntu", repoTag2, "pull")
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/tomcat", repoTag2, "pull")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||
}
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/ubuntu", repoTag2, "pull")
|
||||
err = AccessLog(currentUser.Username, currentProject.Name, currentProject.Name+"/tomcat", repoTag2, "pull")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||
}
|
||||
|
||||
pullCount, err := CountPull(currentProject.Name + "/ubuntu")
|
||||
pullCount, err := CountPull(currentProject.Name + "/tomcat")
|
||||
if err != nil {
|
||||
t.Errorf("Error occurred in CountPull: %v", err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user