예제 #1
0
func TestRedeployDeployment(t *testing.T) {
	setup()
	defer teardown()
	dr := agent.DeploymentResponseLite{Name: "Test"}
	fakeManager := FakeManager{Redeployment: dr}
	handlerCalled := false
	handler := func(w http.ResponseWriter, r *http.Request) {
		handlerCalled = true
		api.ReDeploy(&fakeManager, w, r)
	}
	router.Methods("POST").Path(api.RedeploymentURLForDeploymentID("{id}")).Name("test").HandlerFunc(handler)

	d, err := client.RedeployDeployment("1")
	assert.NoError(t, err)
	assert.Equal(t, "Test", d.Name)
	assert.True(t, handlerCalled)
}
예제 #2
0
파일: client.go 프로젝트: rupakg/panamaxcli
// RedeployDeployment redeploys a specific deployment.
func (c APIClient) RedeployDeployment(id string) (agent.DeploymentResponseLite, error) {
	var deployment agent.DeploymentResponseLite
	err := c.doRequest("POST", api.RedeploymentURLForDeploymentID(id), &deployment, nil)
	return deployment, err
}