From 74e1b03a8061171636655e42656cb9fcf6db9ab5 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 30 Jun 2014 14:28:41 -0700 Subject: [PATCH] Break the dep from util -> api Part 1 in a series of changes towards data validation. --- pkg/util/util_test.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index e48311c7ac9..2c4105f12dd 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -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)