cantabile_edge, cantabile_modbus, cantabile_eebus 0.1.400: full source
This commit is contained in:
1 parent
343331d234
commit
d5fbcacaa4
176 files changed
+32511
-19
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// Copyright © 2026 Setti Solutions S.R.L, www.setti.md. All rights reserved.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// The heartbeat's setup_done: the panel's flag, false without the file.
|
||||
func TestSetupDone(t *testing.T) {
|
||||
p := filepath.Join(t.TempDir(), "config.json")
|
||||
if setupDone(p) {
|
||||
t.Fatal("no file: not set up")
|
||||
}
|
||||
os.WriteFile(p, []byte(`{"admin": "x", "setup_done": true}`), 0o600)
|
||||
if !setupDone(p) {
|
||||
t.Fatal("set up")
|
||||
}
|
||||
os.WriteFile(p, []byte(`{"setup_done": "yes"}`), 0o600)
|
||||
if setupDone(p) {
|
||||
t.Fatal("not a bool")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user