mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 09:59:54 +00:00
This PR focuses on adding unit tests for multiple packages in the project. The main changes include: - Addition of new tests for the 'printer' package in the 'core/pkg/resultshandling/printer' directory. - New tests for the 'results' package in the 'core/pkg/resultshandling' directory. - Addition of tests for the 'config' package in the 'httphandler/config' directory. - New tests for the 'testutils' package in the 'internal/testutils' directory. - Addition of tests for the 'imagescan' package in the 'pkg/imagescan' directory. Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
26 lines
503 B
Go
26 lines
503 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// Loads configuration from file successfully
|
|
func TestLoadConfigFromFileSuccessfully(t *testing.T) {
|
|
// Set up test data
|
|
path := "/path/to/config"
|
|
expectedConfig := Config{
|
|
Namespace: "",
|
|
ClusterName: "",
|
|
ContinuousPostureScan: false,
|
|
}
|
|
|
|
// Call the function under test
|
|
config, err := LoadConfig(path)
|
|
|
|
// Check the result
|
|
assert.Equal(t, expectedConfig, config)
|
|
assert.NotNil(t, err)
|
|
}
|