uri_test_brain.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ---
  2. # post
  3. - name: "test-get-url"
  4. signals:
  5. - order: "test-get-url"
  6. neurons:
  7. - uri:
  8. url: "http://jsonplaceholder.typicode.com/posts/1"
  9. # post
  10. - name: "test-post-url"
  11. signals:
  12. - order: "test-post-url"
  13. neurons:
  14. - uri:
  15. url: "http://jsonplaceholder.typicode.com/posts"
  16. headers:
  17. user-agent: 'my-app/0.0.1'
  18. timeout: 12
  19. method: POST
  20. data: "{\"title\": \"foo\", \"body\": \"bar\", \"userId\": 1}"
  21. # put
  22. - name: "test-put-url"
  23. signals:
  24. - order: "test-put-url"
  25. neurons:
  26. - uri:
  27. url: "http://jsonplaceholder.typicode.com/posts/1"
  28. method: PUT
  29. data: "{\"id\": 1,\"title\": \"foo\", \"body\": \"bar\", \"userId\": 1}"
  30. # patch
  31. - name: "test-patch-url"
  32. signals:
  33. - order: "test-patch-url"
  34. neurons:
  35. - uri:
  36. url: "http://jsonplaceholder.typicode.com/posts/1"
  37. method: PATCH
  38. data: "{\"title\": \"foo\"}"
  39. # delete
  40. - name: "test-delete-url"
  41. signals:
  42. - order: "test-delete-url"
  43. neurons:
  44. - uri:
  45. url: "http://jsonplaceholder.typicode.com/posts/1"
  46. method: DELETE
  47. say_template:
  48. - "{% if status_code==200 %}delete complete{% else %}fail to delete{% endif %}"