mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +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 (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"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) {
|
func TestMakeJSONString(t *testing.T) {
|
||||||
pod := api.Pod{
|
pod := FakePod{
|
||||||
JSONBase: api.JSONBase{ID: "foo"},
|
FakeJSONBase: FakeJSONBase{ID: "foo"},
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
"foo": "bar",
|
"foo": "bar",
|
||||||
"baz": "blah",
|
"baz": "blah",
|
||||||
},
|
},
|
||||||
|
Int: -6,
|
||||||
|
Str: "a string",
|
||||||
}
|
}
|
||||||
|
|
||||||
body := MakeJSONString(pod)
|
body := MakeJSONString(pod)
|
||||||
|
Loading…
Reference in New Issue
Block a user