37 lines
677 B
Go
37 lines
677 B
Go
package application
|
|
|
|
import (
|
|
"github.com/fonchain_enterprise/micro-account/pkg/cache"
|
|
"testing"
|
|
)
|
|
|
|
func TestGetIpAddressByIp2(t *testing.T) {
|
|
config := cache.RedisConfig{
|
|
RedisDB: "2",
|
|
RedisAddr: "127.0.0.1:6379",
|
|
RedisPw: "",
|
|
RedisDbName: "2",
|
|
}
|
|
|
|
cache.LoadRedis(config)
|
|
|
|
type args struct {
|
|
nowIp string
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want string
|
|
}{
|
|
{args: args{nowIp: "58.210.42.242"}},
|
|
// TODO: Add test cases.
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := GetIpAddressByIp(tt.args.nowIp); got != tt.want {
|
|
t.Errorf("GetIpAddressByIp() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|