Remove superfluous Options.Checksum type conversions (#522)

This commit is contained in:
Travis Groth 2020-03-06 17:59:26 -05:00 committed by GitHub
parent 27909f22ce
commit e666306ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 22 deletions

View file

@ -15,19 +15,18 @@ func Test_SetConfigInfo(t *testing.T) {
tests := []struct {
name string
success bool
checksum string
wantLastReload string
wantLastReloadSuccess string
}{
{"success", true, "abcde", "{ { {service test_service} }&{1.", "{ { {service test_service} }&{1} }"},
{"failed", false, "abcde", "", "{ { }&{0} }"},
{"success", true, "{ { {service test_service} }&{1.", "{ { {service test_service} }&{1} }"},
{"failed", false, "", "{ { }&{0} }"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
view.Unregister(InfoViews...)
view.Register(InfoViews...)
SetConfigInfo("test_service", tt.success, tt.checksum)
SetConfigInfo("test_service", tt.success)
testDataRetrieval(ConfigLastReloadView, t, tt.wantLastReload)
testDataRetrieval(ConfigLastReloadSuccessView, t, tt.wantLastReloadSuccess)