Skip to content

Commit

Permalink
feature(main): add check test
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <[email protected]>
  • Loading branch information
cuisongliu committed Oct 22, 2023
1 parent fe988d2 commit a179813
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions pkg/utils/http/url_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
Copyright 2023 [email protected].
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package http

import (
"context"
"github.com/labring/sreg/pkg/registry/sync"
"testing"
)

func TestWaitUntilEndpointAlive(t *testing.T) {
type args struct {
ctx context.Context
endpoint string
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: "default",
args: args{
ctx: context.Background(),
endpoint: sync.ParseRegistryAddress("localhost:5050"),
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := WaitUntilEndpointAlive(tt.args.ctx, tt.args.endpoint); (err != nil) != tt.wantErr {
t.Errorf("WaitUntilEndpointAlive() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

0 comments on commit a179813

Please sign in to comment.