mirror of
https://github.com/shouptech/tempgopher.git
synced 2026-02-03 08:39:43 +00:00
Add tests
This commit is contained in:
parent
e5484d5205
commit
7bb6f5feef
2 changed files with 4 additions and 14 deletions
|
|
@ -23,10 +23,12 @@ func Test_LoadConfig(t *testing.T) {
|
|||
|
||||
testConfig := Config{Sensors: []Sensor{testSensor}}
|
||||
|
||||
loadedConfig, err := LoadConfig("test_config.yml")
|
||||
loadedConfig, err := LoadConfig("tests/test_config.yml")
|
||||
assert.Equal(t, nil, err)
|
||||
assert.Equal(t, &testConfig, loadedConfig)
|
||||
|
||||
_, err = LoadConfig("thisfiledoesnotexist")
|
||||
_, err = LoadConfig("tests/duplicate_id.yml")
|
||||
assert.NotEqual(t, nil, err)
|
||||
_, err = LoadConfig("tests/duplicate_alias.yml")
|
||||
assert.NotEqual(t, nil, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
sensors:
|
||||
- id: 28-000008083108
|
||||
alias: fermenter
|
||||
hightemp: 8
|
||||
lowtemp: 4
|
||||
heatgpio: 5
|
||||
heatinvert: true
|
||||
heatminutes: 5
|
||||
coolgpio: 17
|
||||
coolinvert: false
|
||||
coolminutes: 10
|
||||
verbose: true
|
||||
Loading…
Add table
Reference in a new issue