liuxiaolong
2019-12-27 272db028a5688e90f682240a25120a7d0b32d243
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package WeedFSClient
 
import (
    "fmt"
    "io/ioutil"
    "testing"
)
 
func TestGetFid(t *testing.T) { //1 方法必须传入testing.T 2 方法名必须是以Test开头,驼峰命名
    url := "http://192.168.5.23:6333/dir/assign"
    path,err := GetFid(url)
    if err != nil {
        t.Error("测试失败")
    }
    fmt.Println(path)
}
 
func TestUpDateFile(t *testing.T) { //1 方法必须传入testing.T 2 方法名必须是以Test开头,驼峰命名
    url := "http://192.168.5.23:6120/78,22eae6b7875b67"
    data,err := ioutil.ReadFile("./105.jpg")
    path,err := UpDateFile(url,"",data)
    if err != nil {
        t.Error("测试失败")
    }
    fmt.Println(path)
}