Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gszr committed Mar 13, 2024
1 parent ece257e commit fb3ced4
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions test/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ type Config struct {
shouldExit bool
}

func MockNew() *Config {
return &Config{
// manually change me to see both ways
shouldExit: true,
}
}

// Plugin used for tests
func (conf *Config) Access(kong *pdk.PDK) {
if conf.shouldExit {
kong.Response.Exit(http.StatusInternalServerError, []byte(errors.New("exit").Error()), nil)
}

path, err := kong.Request.GetPath()
if err != nil {
kong.Response.Exit(http.StatusInternalServerError, []byte(err.Error()), nil)
Expand Down Expand Up @@ -54,12 +51,6 @@ func (conf *Config) Access(kong *pdk.PDK) {
}
}

func (c *Config) Response(kong *pdk.PDK) {
if c.shouldExit {
kong.Response.Exit(http.StatusInternalServerError, []byte(errors.New("exit").Error()), nil)
}
}

func TestNoHangingChannel(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit fb3ced4

Please sign in to comment.