feat(connectivity): Allow internet connection validation prior to endpoint execution (#461)

This commit is contained in:
TwiN
2023-05-02 22:41:22 -04:00
committed by GitHub
parent 6908199716
commit 447e140479
6 changed files with 167 additions and 8 deletions

View File

@ -191,6 +191,9 @@ func TestCanCreateTCPConnection(t *testing.T) {
if CanCreateTCPConnection("127.0.0.1", &Config{Timeout: 5 * time.Second}) {
t.Error("should've failed, because there's no port in the address")
}
if !CanCreateTCPConnection("1.1.1.1:53", &Config{Timeout: 5 * time.Second}) {
t.Error("should've succeeded, because that IP should always™ be up")
}
}
// This test checks if a HTTP client configured with `configureOAuth2()` automatically