From dec650cc1cea1f75fdcbddb5d0de13a5f7afe82b Mon Sep 17 00:00:00 2001 From: Himanshu Date: Tue, 26 Jul 2016 20:46:38 +0530 Subject: [PATCH] fixing test not working --- app/services/work_flow_svc/step/manual_step/csv.go | 2 +- .../step/manual_step/manual_step_test.go | 11 ++++++++--- experiments/loadtest_1.go | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/services/work_flow_svc/step/manual_step/csv.go b/app/services/work_flow_svc/step/manual_step/csv.go index f2eba1a48102..273dd3f33a0d 100644 --- a/app/services/work_flow_svc/step/manual_step/csv.go +++ b/app/services/work_flow_svc/step/manual_step/csv.go @@ -60,7 +60,7 @@ func createJSONFile(flus []models.FeedLineUnit, path string, manualStepId uuid.U file, err := os.Create(filePath) if err != nil { plog.Error("Create file error", err, manualStepId) - return constants.Empty, 0, nil + return constants.Empty, 0, err } defer file.Close() diff --git a/app/services/work_flow_svc/step/manual_step/manual_step_test.go b/app/services/work_flow_svc/step/manual_step/manual_step_test.go index 10db4e2bf684..331ee4e6816a 100644 --- a/app/services/work_flow_svc/step/manual_step/manual_step_test.go +++ b/app/services/work_flow_svc/step/manual_step/manual_step_test.go @@ -1,20 +1,22 @@ package manual_step import ( - "fmt" "testing" "time" + "fmt" "github.com/crowdflux/angel/app/models" "github.com/crowdflux/angel/app/models/uuid" "github.com/stretchr/testify/assert" ) func TestManualStep_DownloadCsv(t *testing.T) { - manualStepId, _ := uuid.FromString("7adbafe4-1dc2-4ba3-b8ba-155c87666323") + manualStepId, _ := uuid.FromString("d364cc9e-f267-4fa7-aca0-864f79f4a3c4") resp, err := DownloadCsv(manualStepId) - fmt.Println("Err", err) + assert.NoError(t, err) + + //fmt.Println("Err", err) fmt.Println("Response", resp) /*assert.NoError(t, status, "Error occured while validating") @@ -23,6 +25,9 @@ func TestManualStep_DownloadCsv(t *testing.T) { } func TestManualStep_UploadCsv(t *testing.T) { + + t.Skip("Api has been changed") + err := UploadCsv("filename") assert.NoError(t, err) diff --git a/experiments/loadtest_1.go b/experiments/loadtest_1.go index 38778e74bde4..21bede9c2b46 100644 --- a/experiments/loadtest_1.go +++ b/experiments/loadtest_1.go @@ -12,7 +12,7 @@ import ( var client *http.Client -func main() { +func mainLoadTest() { client = &http.Client{ Transport: &http.Transport{