Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akrantz01 committed Jun 21, 2022
1 parent f8fc88d commit 13574e0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plugins/inputs/cloudwatch/cloudwatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cloudwatch
import (
"context"
"net/http"
"net/url"
"testing"
"time"

Expand Down Expand Up @@ -361,15 +362,17 @@ func TestUpdateWindow(t *testing.T) {
func TestProxyFunction(t *testing.T) {
c := &CloudWatch{
HTTPProxy: proxy.HTTPProxy{
HTTPProxyURL: "http://www.penguins.com",
UseSystemProxy: true,
HTTPProxyURL: "http://www.penguins.com",
},
}

proxyFunction, err := c.HTTPProxy.Proxy()
require.NoError(t, err)

proxyResult, err := proxyFunction(&http.Request{})
u, err := url.Parse("https://monitoring.us-west-1.amazonaws.com/")
require.NoError(t, err)

proxyResult, err := proxyFunction(&http.Request{URL: u})
require.NoError(t, err)
require.Equal(t, "www.penguins.com", proxyResult.Host)
}
Expand Down

0 comments on commit 13574e0

Please sign in to comment.