Skip to content

Commit

Permalink
simple test for proxy function
Browse files Browse the repository at this point in the history
  • Loading branch information
yashsinghcodes committed Aug 27, 2024
1 parent 4b5b04c commit 5b74a57
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package shuffle

import (
"testing"
"net/http"
)

func TestIsLoop(t *testing.T) {
Expand All @@ -26,3 +27,17 @@ func TestIsLoop(t *testing.T) {
}
}
}

// Simple Test for HandleInternalProxy(client)
// set env SHUFFLE_INTERNAL_HTTP_PROXY to test the function.
func TestHandleInternalProxy(t *testing.T) {
client := &http.Client{}
result := HandleInternalProxy(client)

if result.Transport.(*http.Transport).Proxy != nil {
proxyURL, _ := result.Transport.(*http.Transport).Proxy(nil)
t.Logf("Proxy URL set: %v", proxyURL)
} else {
t.Log("No proxy set")
}
}

0 comments on commit 5b74a57

Please sign in to comment.