uri_test_brain.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. # GET
  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. file_template: "neurons/uri/tests/test_get_template.j2"
  10. # POST
  11. - name: "test-post-url"
  12. signals:
  13. - order: "test-post-url"
  14. neurons:
  15. - uri:
  16. url: "http://jsonplaceholder.typicode.com/posts"
  17. headers:
  18. user-agent: 'my-app/0.0.1'
  19. Content-Type: 'application/json'
  20. timeout: 12
  21. method: POST
  22. data_from_file: "neurons/uri/tests/data_post_test.json"
  23. say_template:
  24. - "{{ content.id }}"
  25. # PUT
  26. - name: "test-put-url"
  27. signals:
  28. - order: "test-put-url"
  29. neurons:
  30. - uri:
  31. url: "http://jsonplaceholder.typicode.com/posts/1"
  32. method: PUT
  33. data: "{\"id\": 1,\"title\": \"foo\", \"body\": \"bar\", \"userId\": 1}"
  34. # PATCH
  35. - name: "test-patch-url"
  36. signals:
  37. - order: "test-patch-url"
  38. neurons:
  39. - uri:
  40. url: "http://jsonplaceholder.typicode.com/posts/1"
  41. method: PATCH
  42. data: "{\"title\": \"foo\"}"
  43. # DELETE
  44. - name: "test-delete-url"
  45. signals:
  46. - order: "test-delete-url"
  47. neurons:
  48. - uri:
  49. url: "http://jsonplaceholder.typicode.com/posts/1"
  50. method: DELETE
  51. say_template:
  52. - "{% if status_code==200 %}delete complete{% else %}fail to delete{% endif %}"