more aliases tests

This commit is contained in:
Radu Ioan Fericean
2014-02-27 09:34:48 +02:00
parent b3dee97bc4
commit 83dd4efeab
2 changed files with 21 additions and 0 deletions

View File

@@ -741,6 +741,19 @@ func TestLoadAccountActions(t *testing.T) {
}
}
func TestLoadAliases(t *testing.T) {
if len(csvr.aliases) != 5 {
t.Error("Failed to load aliases: ", csvr.aliases)
}
if csvr.aliases[RATING_PROFILE_PREFIX+"a1"] != "minu" ||
csvr.aliases[RATING_PROFILE_PREFIX+"a2"] != "minu" ||
csvr.aliases[RATING_PROFILE_PREFIX+"a3"] != "minu" ||
csvr.aliases[ACCOUNT_PREFIX+"a1"] != "minitsboy" ||
csvr.aliases[ACCOUNT_PREFIX+"a2"] != "minitsboy" {
t.Error("Error loading aliases: ", csvr.aliases)
}
}
/*
vdf,minitsboy,*out,MORE_MINUTES,STANDARD_TRIGGER
*/

View File

@@ -21,6 +21,8 @@ package engine
import (
"testing"
"time"
"github.com/cgrates/cgrates/cache2go"
)
func TestMsgpackStructsAdded(t *testing.T) {
@@ -107,6 +109,12 @@ func TestCacheRefresh(t *testing.T) {
}
}
func TestCacheAliases(t *testing.T) {
if subj, err := cache2go.GetCached(ALIAS_PREFIX + RATING_PROFILE_PREFIX + "a3"); err != nil || subj != "minu" {
t.Error("Error caching alias: ", subj, err)
}
}
// Install fails to detect them and starting server will panic, these tests will fix this
func TestStoreInterfaces(t *testing.T) {
rds := new(RedisStorage)