fix cyclic dependancy + duplicate test

This commit is contained in:
farhansolodev
2023-04-03 06:16:29 +04:00
parent fbbb23c13a
commit 53bef115b0

View File

@@ -1,28 +1,28 @@
package config package generate
import ( import (
"fmt" "fmt"
"github.com/Akilan1999/p2p-rendering-computation/config/generate" "github.com/Akilan1999/p2p-rendering-computation/config"
"os" "os"
"testing" "testing"
) )
func TestConfigInit(t *testing.T) { // func TestConfigInit(t *testing.T) {
_, err := ConfigInit(nil) // _, err := config.ConfigInit(nil)
if err != nil { // if err != nil {
t.Error(err) // t.Error(err)
} // }
} // }
func TestSetDefaults(t *testing.T) { // func TestSetDefaults(t *testing.T) {
_, err := generate.SetDefaults("", false) // _, err := SetDefaults("", false)
if err != nil { // if err != nil {
t.Error(err) // t.Error(err)
} // }
} // }
func TestGetCurrentPath(t *testing.T) { func TestGetCurrentPath(t *testing.T) {
path, err := generate.GetCurrentPath() path, err := GetCurrentPath()
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
t.Error(err) t.Error(err)
@@ -31,7 +31,7 @@ func TestGetCurrentPath(t *testing.T) {
} }
func TestGetPathP2PRC(t *testing.T) { func TestGetPathP2PRC(t *testing.T) {
path, err := GetPathP2PRC("") path, err := config.GetPathP2PRC("")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
t.Error(err) t.Error(err)
@@ -48,14 +48,14 @@ func TestSetEnvName(t *testing.T) {
} }
// Sets the environment variable as the default to read // Sets the environment variable as the default to read
// for P2PRC // for P2PRC
err = SetEnvName("TEST") err = config.SetEnvName("TEST")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
t.Error(err) t.Error(err)
} }
// Checks if the output for the default read is "lol" // Checks if the output for the default read is "lol"
path, err := GetPathP2PRC("") path, err := config.GetPathP2PRC("")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
t.Error(err) t.Error(err)