mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 18:09:55 +00:00
mocks
This commit is contained in:
@@ -19,7 +19,8 @@ Please note we have a code of conduct, please follow it in all your interactions
|
||||
build.
|
||||
2. Update the README.md with details of changes to the interface, this includes new environment
|
||||
variables, exposed ports, useful file locations and container parameters.
|
||||
3. We will merge the Pull Request in once you have the sign-off.
|
||||
3. Open Pull Request to `dev` branch - we test the component before merging into the `master` branch
|
||||
4. We will merge the Pull Request in once you have the sign-off.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ func NewOPASessionObjMock() *OPASessionObj {
|
||||
K8SResources: nil,
|
||||
AllResources: make(map[string]workloadinterface.IMetadata),
|
||||
ResourcesResult: make(map[string]resourcesresults.Result),
|
||||
Report: &reporthandlingv2.PostureReport{},
|
||||
PostureReport: &reporthandling.PostureReport{
|
||||
ClusterName: "",
|
||||
CustomerGUID: "",
|
||||
|
||||
20
cautils/getter/loadpolicy_test.go
Normal file
20
cautils/getter/loadpolicy_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package getter
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var mockFrameworkBasePath = filepath.Join("examples", "mocks", "frameworks")
|
||||
|
||||
func MockNewLoadPolicy() *LoadPolicy {
|
||||
return &LoadPolicy{
|
||||
filePaths: []string{""},
|
||||
}
|
||||
}
|
||||
|
||||
func TestBla(t *testing.T) {
|
||||
dir, _ := os.Getwd()
|
||||
t.Error(dir)
|
||||
}
|
||||
36
mocks/loadmocks.go
Normal file
36
mocks/loadmocks.go
Normal file
File diff suppressed because one or more lines are too long
18
opaprocessor/utils_test.go
Normal file
18
opaprocessor/utils_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package opaprocessor
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/armosec/kubescape/mocks"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/armosec/opa-utils/reporthandling"
|
||||
)
|
||||
|
||||
func TestConvertFrameworksToPolicies(t *testing.T) {
|
||||
fw0 := mocks.MockFramework_0006_0013()
|
||||
fw1 := mocks.MockFramework_0044()
|
||||
policies := ConvertFrameworksToPolicies([]reporthandling.Framework{*fw0, *fw1}, "")
|
||||
assert.Equal(t, 2, len(policies.Frameworks))
|
||||
assert.Equal(t, 3, len(policies.Controls))
|
||||
}
|
||||
@@ -123,8 +123,6 @@ func (resultsHandler *ResultsHandler) reportV2ToV1(opaSessionObj *cautils.OPASes
|
||||
}
|
||||
}
|
||||
|
||||
// rulev1.ListInputKinds
|
||||
|
||||
}
|
||||
fwv1.ControlReports = append(fwv1.ControlReports, crv1)
|
||||
|
||||
|
||||
4
resultshandling/results_test.go
Normal file
4
resultshandling/results_test.go
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user