mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 01:27:49 +01:00
remove watch testing case
This commit is contained in:
parent
cbdf49c8e9
commit
35c62da69c
@ -1,36 +0,0 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var jsonText = `
|
||||
{
|
||||
"scan_all_policy": {
|
||||
"type": "daily",
|
||||
"parameter": {
|
||||
"daily_time": <PLACE_HOLDER>
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
func TestWatchConfiguration(t *testing.T) {
|
||||
now := time.Now().UTC()
|
||||
offset := (now.Hour()+1)*3600 + now.Minute()*60
|
||||
jsonT := strings.Replace(jsonText, "<PLACE_HOLDER>", strconv.Itoa(offset), -1)
|
||||
v := make(map[string]interface{})
|
||||
if err := json.Unmarshal([]byte(jsonT), &v); err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if err := watchConfigChanges(v); err != nil {
|
||||
if !strings.Contains(err.Error(), "No handlers registered") {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user