Skip to content

Commit

Permalink
fix metricstest iter1
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrodriges committed Jun 27, 2024
1 parent f8878c2 commit 3a4510a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions cmd/metricstest/iteration1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 3a4510a

Please sign in to comment.