From 3a4510a5a93004022e33b977bd8134293f138f32 Mon Sep 17 00:00:00 2001 From: bbrodriges Date: Thu, 27 Jun 2024 16:03:38 +0400 Subject: [PATCH] fix metricstest iter1 --- cmd/metricstest/iteration1_test.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cmd/metricstest/iteration1_test.go b/cmd/metricstest/iteration1_test.go index b021f44..177f21e 100644 --- a/cmd/metricstest/iteration1_test.go +++ b/cmd/metricstest/iteration1_test.go @@ -8,10 +8,9 @@ import ( "syscall" "time" + "github.com/Yandex-Practicum/go-autotests/internal/fork" "github.com/go-resty/resty/v2" "github.com/stretchr/testify/suite" - - "github.com/Yandex-Practicum/go-autotests/internal/fork" ) type Iteration1Suite struct { @@ -92,7 +91,7 @@ func (suite *Iteration1Suite) TestGaugeHandlers() { httpc := resty.New().SetHostURL(suite.serverAddress) suite.Run("update", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/gauge/testGauge/100") noRespErr := suite.Assert().NoError(err, @@ -108,7 +107,7 @@ func (suite *Iteration1Suite) TestGaugeHandlers() { }) suite.Run("without id", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/gauge/") noRespErr := suite.Assert().NoError(err, @@ -124,7 +123,7 @@ func (suite *Iteration1Suite) TestGaugeHandlers() { }) suite.Run("invalid value", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/gauge/testGauge/none") noRespErr := suite.Assert().NoError(err, @@ -144,7 +143,7 @@ func (suite *Iteration1Suite) TestCounterHandlers() { httpc := resty.New().SetHostURL(suite.serverAddress) suite.Run("update", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/counter/testCounter/100") noRespErr := suite.Assert().NoError(err, @@ -160,7 +159,7 @@ func (suite *Iteration1Suite) TestCounterHandlers() { }) suite.Run("without id", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/counter/") noRespErr := suite.Assert().NoError(err, @@ -176,7 +175,7 @@ func (suite *Iteration1Suite) TestCounterHandlers() { }) suite.Run("invalid value", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/counter/testCounter/none") noRespErr := suite.Assert().NoError(err, @@ -196,7 +195,7 @@ func (suite *Iteration1Suite) TestUnknownHandlers() { httpc := resty.New().SetHostURL(suite.serverAddress) suite.Run("update invalid type", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("update/unknown/testCounter/100") noRespErr := suite.Assert().NoError(err, @@ -212,7 +211,7 @@ func (suite *Iteration1Suite) TestUnknownHandlers() { }) suite.Run("update invalid method", func() { - req := httpc.R() + req := httpc.R().SetHeader("Content-Type", "text/plain") resp, err := req.Post("updater/counter/testCounter/100") noRespErr := suite.Assert().NoError(err,