mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 15:35:59 -07:00
Add additional coverage for yaml_util (#10674)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# This file should be ignored
|
||||
platform: template
|
||||
name: "Hidden Sensor"
|
||||
@@ -0,0 +1 @@
|
||||
This is not a YAML file and should be ignored
|
||||
@@ -0,0 +1,4 @@
|
||||
platform: template
|
||||
name: "Sensor 1"
|
||||
lambda: |-
|
||||
return 42.0;
|
||||
@@ -0,0 +1,4 @@
|
||||
platform: template
|
||||
name: "Sensor 2"
|
||||
lambda: |-
|
||||
return 100.0;
|
||||
@@ -0,0 +1,4 @@
|
||||
platform: template
|
||||
name: "Sensor 3 in subdir"
|
||||
lambda: |-
|
||||
return 200.0;
|
||||
4
tests/unit_tests/fixtures/yaml_util/secrets.yaml
Normal file
4
tests/unit_tests/fixtures/yaml_util/secrets.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
test_secret: "my_secret_value"
|
||||
another_secret: "another_value"
|
||||
wifi_password: "super_secret_wifi"
|
||||
api_key: "0123456789abcdef"
|
||||
17
tests/unit_tests/fixtures/yaml_util/test_secret.yaml
Normal file
17
tests/unit_tests/fixtures/yaml_util/test_secret.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
esphome:
|
||||
name: test_device
|
||||
platform: ESP32
|
||||
board: esp32dev
|
||||
|
||||
wifi:
|
||||
ssid: "TestNetwork"
|
||||
password: !secret wifi_password
|
||||
|
||||
api:
|
||||
encryption:
|
||||
key: !secret api_key
|
||||
|
||||
sensor:
|
||||
- platform: template
|
||||
name: "Test Sensor"
|
||||
id: !secret test_secret
|
||||
Reference in New Issue
Block a user