Skip to content

Commit

Permalink
add cluster test
Browse files Browse the repository at this point in the history
Signed-off-by: pashakostohrys <pavel@codefresh.io>
  • Loading branch information
pasha-codefresh committed Oct 15, 2024
1 parent 7dede17 commit d8ebadd
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pkg/apis/application/v1alpha1/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4265,3 +4265,35 @@ func TestAppProject_ValidateDestinationServiceAccount(t *testing.T) {
}
}
}

func TestCluster_ParseProxyUrl(t *testing.T) {
testData := []struct {
url string
expectedErrMsg string
}{
{
url: "https://192.168.99.100:8443",
expectedErrMsg: "",
},
{
url: "test://!abc",
expectedErrMsg: "unsupported scheme \"test\", must be http, https, or socks5",
},
{
url: "http://192.168.99.100:8443",
expectedErrMsg: "",
},
{
url: "socks5://192.168.99.100:8443",
expectedErrMsg: "",
},
}
for _, data := range testData {
_, err := ParseProxyUrl(data.url)
if data.expectedErrMsg == "" {
require.NoError(t, err)
} else {
require.ErrorContains(t, err, data.expectedErrMsg)
}
}
}

0 comments on commit d8ebadd

Please sign in to comment.