mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #308 from thockin/valid2
Break the dep from util -> api
This commit is contained in:
commit
c292b72495
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user