37 lines
616 B
Go
37 lines
616 B
Go
package infra
|
|
|
|
import (
|
|
"encoding/json"
|
|
"git.loafle.net/overflow/commons_go/model/timestamp"
|
|
"git.loafle.net/overflow/overflow_service/proxy/meta"
|
|
"testing"
|
|
)
|
|
|
|
func TestInfraRegist(t *testing.T) {
|
|
is := InfraService{}
|
|
|
|
infraType := meta.MetaInfraType{
|
|
Id: json.Number("1"),
|
|
}
|
|
|
|
infra := &Infra{
|
|
MetaInfraType: infraType,
|
|
ChildId: json.Number("0"),
|
|
CreateDate: timestamp.Now(),
|
|
}
|
|
res, err := is.Regist(infra)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(res)
|
|
}
|
|
|
|
func TestInfraList(t *testing.T) {
|
|
is := InfraService{}
|
|
res, err := is.Read("1")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(res)
|
|
}
|