Fixup tests

This commit is contained in:
derekwaynecarr
2014-10-02 12:52:01 -04:00
parent fc67d822c6
commit d5ec260db8
3 changed files with 38 additions and 33 deletions

View File

@@ -49,13 +49,13 @@ type FakePodControl struct {
lock sync.Mutex
}
func (f *FakePodControl) createReplica(spec api.ReplicationController) {
func (f *FakePodControl) createReplica(ctx api.Context, spec api.ReplicationController) {
f.lock.Lock()
defer f.lock.Unlock()
f.controllerSpec = append(f.controllerSpec, spec)
}
func (f *FakePodControl) deletePod(podID string) error {
func (f *FakePodControl) deletePod(ctx api.Context, podID string) error {
f.lock.Lock()
defer f.lock.Unlock()
f.deletePodID = append(f.deletePodID, podID)
@@ -169,6 +169,7 @@ func TestSyncReplicationControllerCreates(t *testing.T) {
}
func TestCreateReplica(t *testing.T) {
ctx := api.NewDefaultContext()
body := runtime.EncodeOrDie(testapi.CodecForVersionOrDie(), &api.Pod{})
fakeHandler := util.FakeHandler{
StatusCode: 200,
@@ -204,7 +205,7 @@ func TestCreateReplica(t *testing.T) {
},
}
podControl.createReplica(controllerSpec)
podControl.createReplica(ctx, controllerSpec)
expectedPod := api.Pod{
JSONBase: api.JSONBase{
@@ -323,7 +324,7 @@ type FakeWatcher struct {
*client.Fake
}
func (fw FakeWatcher) WatchReplicationControllers(l, f labels.Selector, rv uint64) (watch.Interface, error) {
func (fw FakeWatcher) WatchReplicationControllers(ctx api.Context, l, f labels.Selector, rv uint64) (watch.Interface, error) {
return fw.w, nil
}