Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

28 lines
862B

  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 TestPatchAttachmentInfo(t *testing.T) {
  11. //crmPatchAttachmentInfo("591e5f7b9463d7147")
  12. crmCreateAttachment("abc")
  13. }
  14. func TestDecodeJsonResponse(t *testing.T) {
  15. msg := `
  16. {"id":"591e55398345683ee","name":"static_qr_code_without_logo.png","deleted":false,"type":"image\/png"
  17. ,"size":509,"sourceId":null,"createdAt":"2017-05-19 02:15:21","role":"Attachment","storage":null,"storageFilePath"
  18. :null,"global":false,"parentId":null,"parentType":null,"relatedId":null,"relatedType":null,"createdById"
  19. :"1","createdByName":"Admin"} `
  20. info := attachmentInfo{}
  21. err := json.Unmarshal([]byte(msg), &info)
  22. AssertEqual(t, err, nil, "json decode shold be correct")
  23. }