mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
23 lines
453 B
Go
23 lines
453 B
Go
package openbgpd
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io/ioutil"
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
func readTestData(filename string) map[string]interface{} {
|
|
data, _ := ioutil.ReadFile(filepath.Join("testdata", filename))
|
|
payload := make(map[string]interface{})
|
|
json.Unmarshal(data, &payload)
|
|
return payload
|
|
}
|
|
|
|
func TestDecodeAPIStatus(t *testing.T) {
|
|
res := readTestData("status.json")
|
|
s := decodeAPIStatus(res)
|
|
t.Log(s.ServerTime)
|
|
t.Log(s.LastReboot)
|
|
}
|