github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/generator/api_doc_test.go (about) 1 package generator 2 3 import ( 4 "os" 5 "testing" 6 7 "github.com/go-courier/codegen" 8 ) 9 10 func init() { 11 os.Chdir("..") 12 } 13 14 func TestAPIDoc(t *testing.T) { 15 d := NewAPIDoc(&APIDocEntries{ 16 ContentsURL: "https://cloud.tencent.com/document/api/213/15689", 17 DataTypesURL: "https://cloud.tencent.com/document/api/213/15753", 18 }) 19 20 d.Scan() 21 22 f := codegen.NewFile(d.Service, "test.go") 23 24 d.APIs["DescribeInstances"].Write(f) 25 26 t.Log(string(f.Bytes())) 27 }