Merge pull request #880 from amirmalka/dev

commented out tests which made actual http calls
This commit is contained in:
Amir Malka
2022-10-25 18:45:38 +03:00
committed by GitHub
3 changed files with 11 additions and 6 deletions
+3 -2
View File
@@ -18,7 +18,8 @@ func TestSetContextMetadata(t *testing.T) {
assert.Nil(t, ctx.HelmContextMetadata)
assert.Nil(t, ctx.RepoContextMetadata)
}
{
// TODO: tests were commented out due to actual http calls ; http calls should be mocked.
/*{
ctx := reporthandlingv2.ContextMetadata{}
setContextMetadata(&ctx, "https://github.com/kubescape/kubescape")
@@ -31,7 +32,7 @@ func TestSetContextMetadata(t *testing.T) {
assert.Equal(t, "kubescape", ctx.RepoContextMetadata.Repo)
assert.Equal(t, "kubescape", ctx.RepoContextMetadata.Owner)
assert.Equal(t, "master", ctx.RepoContextMetadata.Branch)
}
}*/
}
func TestGetHostname(t *testing.T) {
@@ -13,6 +13,10 @@ var (
urlD = "https://raw.githubusercontent.com/kubescape/kubescape/master/examples/online-boutique/adservice.yaml"
)
/*
TODO: tests were commented out due to actual http calls ; http calls should be mocked.
func TestScanRepository(t *testing.T) {
{
files, err := ScanRepository(urlA, "")
@@ -112,6 +116,7 @@ func TestGithubGetYamlFromTree(t *testing.T) {
assert.Equal(t, 12, len(files))
}
}
*/
func TestGithubParse(t *testing.T) {
{
+3 -4
View File
@@ -2,12 +2,11 @@ package resourcehandler
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestLoadResourcesFromUrl(t *testing.T) {
{
//TODO: tests were commented out due to actual http calls ; http calls should be mocked.
/*{
workloads, err := loadResourcesFromUrl([]string{"https://github.com/kubescape/kubescape/tree/master/examples/online-boutique"})
assert.NoError(t, err)
assert.Equal(t, 12, len(workloads))
@@ -62,5 +61,5 @@ func TestLoadResourcesFromUrl(t *testing.T) {
assert.Equal(t, "/v1//Service/adservice", w[1].GetID())
}
}
}
}*/
}