Merge pull request #308 from thockin/valid2

Break the dep from util -> api
This commit is contained in:
Daniel Smith 2014-06-30 15:22:55 -07:00
commit c292b72495

View File

@ -19,17 +19,27 @@ package util
import (
"encoding/json"
"testing"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
)
type FakeJSONBase struct {
ID string
}
type FakePod struct {
FakeJSONBase `json:",inline" yaml:",inline"`
Labels map[string]string
Int int
Str string
}
func TestMakeJSONString(t *testing.T) {
pod := api.Pod{
JSONBase: api.JSONBase{ID: "foo"},
pod := FakePod{
FakeJSONBase: FakeJSONBase{ID: "foo"},
Labels: map[string]string{
"foo": "bar",
"baz": "blah",
},
Int: -6,
Str: "a string",
}
body := MakeJSONString(pod)