Commit 2fcf634b by feidy

测试自动生成测试用例

parent 9c719166
/*
* @Author: zhoufei
* @Date: 2022-03-15 18:26:05
* @LastEditors: zhoufei
* @LastEditTime: 2022-06-30 15:29:40
* @FilePath: /utils/strconv_test.go
* @Description:
*
* Copyright (c) 2022 by zhoufei, All Rights Reserved.
*/
package utils
import (
"fmt"
"testing"
"github.com/imroc/req/v3"
)
func TestIntToString(t *testing.T) {
type args struct {
a int
}
tests := []struct {
name string
args args
want string
}{
{
name: "test",
args: args{
a: 1,
},
want: "1",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := IntToString(tt.args.a); got != tt.want {
t.Errorf("IntToString() = %v, want %v", got, tt.want)
}
})
}
}
func TestHttpRequest(t *testing.T) {
req1 := req.C().R().SetBasicAuth("ceshi", "123456")
res, err := req1.SetHeader("Content-type", "application/json").SetBody(`{"a":"1"}`).Post("http://192.168.31.221:8081/push")
if err != nil {
t.Failed()
}
fmt.Println(res)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment