mirror of
https://github.com/esphome/esphome.git
synced 2024-11-21 22:48:10 +01:00
Add actions to http_request tests (#6529)
This commit is contained in:
parent
1ab4fc8faf
commit
6370e68670
4 changed files with 43 additions and 21 deletions
37
tests/components/http_request/common.yaml
Normal file
37
tests/components/http_request/common.yaml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
esphome:
|
||||||
|
on_boot:
|
||||||
|
then:
|
||||||
|
- http_request.get:
|
||||||
|
url: https://esphome.io
|
||||||
|
headers:
|
||||||
|
Content-Type: application/json
|
||||||
|
verify_ssl: false
|
||||||
|
on_response:
|
||||||
|
then:
|
||||||
|
- logger.log:
|
||||||
|
format: 'Response status: %d, Duration: %u ms'
|
||||||
|
args:
|
||||||
|
- status_code
|
||||||
|
- duration_ms
|
||||||
|
- http_request.post:
|
||||||
|
url: https://esphome.io
|
||||||
|
headers:
|
||||||
|
Content-Type: application/json
|
||||||
|
json:
|
||||||
|
key: value
|
||||||
|
verify_ssl: false
|
||||||
|
- http_request.send:
|
||||||
|
method: PUT
|
||||||
|
url: https://esphome.io
|
||||||
|
headers:
|
||||||
|
Content-Type: application/json
|
||||||
|
body: "Some data"
|
||||||
|
verify_ssl: false
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
ssid: MySSID
|
||||||
|
password: password1
|
||||||
|
|
||||||
|
http_request:
|
||||||
|
useragent: esphome/tagreader
|
||||||
|
timeout: 10s
|
|
@ -1,7 +1,2 @@
|
||||||
wifi:
|
packages:
|
||||||
ssid: MySSID
|
common: !include common.yaml
|
||||||
password: password1
|
|
||||||
|
|
||||||
http_request:
|
|
||||||
useragent: esphome/tagreader
|
|
||||||
timeout: 10s
|
|
||||||
|
|
|
@ -1,7 +1,2 @@
|
||||||
wifi:
|
packages:
|
||||||
ssid: MySSID
|
common: !include common.yaml
|
||||||
password: password1
|
|
||||||
|
|
||||||
http_request:
|
|
||||||
useragent: esphome/tagreader
|
|
||||||
timeout: 10s
|
|
||||||
|
|
|
@ -1,7 +1,2 @@
|
||||||
wifi:
|
packages:
|
||||||
ssid: MySSID
|
common: !include common.yaml
|
||||||
password: password1
|
|
||||||
|
|
||||||
http_request:
|
|
||||||
useragent: esphome/tagreader
|
|
||||||
timeout: 10s
|
|
||||||
|
|
Loading…
Reference in a new issue