mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Covered tests in config
This commit is contained in:
committed by
Dan Christian Bogos
parent
26fc655f2c
commit
2f97825063
@@ -987,6 +987,36 @@ func TestDbDefaults(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewCGRConfigFromJSONStringWithDefaultsError(t *testing.T) {
|
||||
cfgJSONStr := "invalidJSON"
|
||||
expectedErr := "invalid character 'i' looking for beginning of value around line 1 and position 1\n line: \"invalidJSON\""
|
||||
if _, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err == nil || err.Error() != expectedErr {
|
||||
t.Errorf("Expected %+v, received %+v", expectedErr, err)
|
||||
}
|
||||
|
||||
cfgJSONStr = `{
|
||||
"suretax": {
|
||||
"tax_exemption_code_list": "a{*"
|
||||
},
|
||||
}`
|
||||
expectedErr = "invalid converter terminator in rule: <a{*>"
|
||||
if _, err := NewCGRConfigFromJSONStringWithDefaults(cfgJSONStr); err == nil || err.Error() != expectedErr {
|
||||
t.Errorf("Expected %+v, received %+v", expectedErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsHidden(t *testing.T) {
|
||||
file := ".newFile"
|
||||
if !isHidden(file) {
|
||||
t.Errorf("File is not hidden")
|
||||
}
|
||||
|
||||
file = "."
|
||||
if isHidden(file) {
|
||||
t.Errorf("Invalid input")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCgrLoaderCfgITDefaults(t *testing.T) {
|
||||
eCfg := LoaderSCfgs{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user