Some more test cases in rtmgr
[ric-plt/rtmgr.git] / pkg / rtmgr / rtmgr_test.go
index 2f02b99..9ffca04 100644 (file)
@@ -32,18 +32,14 @@ import (
        "testing"
 )
 
-func TestSetLogLevel(t *testing.T) {
-       modeIsOk := []string{"info", "warn", "debug", "error"}
-       modeOsNok := []string{"inValId", "LogLEVEL", "Provided"}
-       for _, value := range modeIsOk {
-               if SetLogLevel(value) != nil {
-                       t.Error("Invalid log level: " + value)
-               }
-       }
-
-       for _, value := range modeOsNok {
-               if SetLogLevel(value) == nil {
-                       t.Error("Invalid log level: " + value)
-               }
-       }
+func TestGetPlatformComponents(t *testing.T) {
+       //Check epty file
+       _, err := GetPlatformComponents("")
+       t.Log(err)
+
+       //Valid JSON file
+       _, err = GetPlatformComponents("/tmp/go/src/routing-manager/manifests/rtmgr/rtmgr-cfg.yaml")
+
+       //Invalid JSON file
+       _, err = GetPlatformComponents("./pkg/rtmg/rtmgr.go")
 }