No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

31 líneas
906B

  1. package main
  2. import "testing"
  3. import "log"
  4. import "encoding/json"
  5. func TestCRMAttachFile(t *testing.T) {
  6. r, e := crmCreateAttachment("media_for_test/200x200.png")
  7. log.Println(r)
  8. log.Println(e)
  9. }
  10. func TestDecodeJsonResponse(t *testing.T) {
  11. msg := `
  12. {"id":"591e55398345683ee","name":"static_qr_code_without_logo.png","deleted":false,"type":"image\/png"
  13. ,"size":509,"sourceId":null,"createdAt":"2017-05-19 02:15:21","role":"Attachment","storage":null,"storageFilePath"
  14. :null,"global":false,"parentId":null,"parentType":null,"relatedId":null,"relatedType":null,"createdById"
  15. :"1","createdByName":"Admin"} `
  16. info := attachmentInfo{}
  17. err := json.Unmarshal([]byte(msg), &info)
  18. AssertEqual(t, err, nil, "json decode shold be correct")
  19. }
  20. func TestCRMDownloadAttachment(t *testing.T) {
  21. id := "59054884ef1b0c04f"
  22. //crmDownloadAttachment(id)
  23. crmDownloadAttachmentAs(id, "/tmp/wechat_hitxy_测试")
  24. }