mirror of
https://github.com/goharbor/harbor.git
synced 2024-07-08 21:04:51 +02: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) {
|
func TestGetAccessLogCreator(t *testing.T) {
|
||||||
var err error
|
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 {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
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 {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
user, err := GetAccessLogCreator(currentProject.Name + "/ubuntu")
|
user, err := GetAccessLogCreator(currentProject.Name + "/tomcat")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in GetAccessLogCreator: %v", err)
|
t.Errorf("Error occurred in GetAccessLogCreator: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -552,20 +552,20 @@ func TestGetAccessLogCreator(t *testing.T) {
|
||||||
|
|
||||||
func TestCountPull(t *testing.T) {
|
func TestCountPull(t *testing.T) {
|
||||||
var err error
|
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 {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
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 {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
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 {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in AccessLog: %v", err)
|
t.Errorf("Error occurred in AccessLog: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
pullCount, err := CountPull(currentProject.Name + "/ubuntu")
|
pullCount, err := CountPull(currentProject.Name + "/tomcat")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error occurred in CountPull: %v", err)
|
t.Errorf("Error occurred in CountPull: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user