goProject/.svn/pristine/ec/ec041b29985e3681afcb3eaa56dda606f6e0d51f.svn-base
2025-01-06 16:21:36 +08:00

27 lines
587 B
Plaintext

package webUtil
import (
"goutil/zlibUtil"
"testing"
)
func TestPostWebData(t *testing.T) {
weburl := "https://managecenterapitest-sd3.7qule.com/API/ServerActivate.ashx"
postDict := make(map[string]string, 0)
postDict["ServerGroupID"] = "20002"
resp, err := PostWebData(weburl, postDict, nil)
if err != nil {
t.Errorf("测试错误,返回的结果为:%s", err)
}
if len(resp) == 0 {
t.Errorf("返回的数据为空,期望不为空")
}
// 将收到的数据进行zlib解压缩
_, err = zlibUtil.Decompress(resp)
if err != nil {
t.Errorf("Error:%s", err)
}
}