From 88daa45e3b8e11889f11886b075b4467a79ccb17 Mon Sep 17 00:00:00 2001 From: DanB Date: Mon, 2 Mar 2015 13:33:46 +0100 Subject: [PATCH] Add websockets in external libs script, small local tests modification --- apier/v1/apier_local_test.go | 12 ++++++------ update_external_libs.sh | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apier/v1/apier_local_test.go b/apier/v1/apier_local_test.go index 045688f14..f1647c3a0 100644 --- a/apier/v1/apier_local_test.go +++ b/apier/v1/apier_local_test.go @@ -217,7 +217,7 @@ func TestApierTPTiming(t *testing.T) { // Test getIds var rplyTmIds []string expectedTmIds := []string{"ALWAYS", "ASAP"} - if err := rater.Call("ApierV1.GetTPTimingIds", AttrGetTPTimingIds{tmAlways.TPid, utils.Paginator{Page: 0, ItemsPerPage: 0, SearchTerm: ""}}, &rplyTmIds); err != nil { + if err := rater.Call("ApierV1.GetTPTimingIds", AttrGetTPTimingIds{tmAlways.TPid, utils.Paginator{}}, &rplyTmIds); err != nil { t.Error("Calling ApierV1.GetTPTimingIds, got error: ", err.Error()) } else if !reflect.DeepEqual(expectedTmIds, rplyTmIds) { t.Errorf("Calling ApierV1.GetTPTimingIds expected: %v, received: %v", expectedTmIds, rplyTmIds) @@ -325,7 +325,7 @@ func TestApierTPRate(t *testing.T) { // Test getIds var rplyRtIds []string expectedRtIds := []string{"RT_FS_USERS"} - if err := rater.Call("ApierV1.GetTPRateIds", AttrGetTPRateIds{rt.TPid, utils.Paginator{Page: 0, ItemsPerPage: 0, SearchTerm: ""}}, &rplyRtIds); err != nil { + if err := rater.Call("ApierV1.GetTPRateIds", AttrGetTPRateIds{rt.TPid, utils.Paginator{}}, &rplyRtIds); err != nil { t.Error("Calling ApierV1.GetTPRateIds, got error: ", err.Error()) } else if !reflect.DeepEqual(expectedRtIds, rplyRtIds) { t.Errorf("Calling ApierV1.GetTPDestinationIds expected: %v, received: %v", expectedRtIds, rplyRtIds) @@ -382,7 +382,7 @@ func TestApierTPDestinationRate(t *testing.T) { // Test getIds var rplyDrIds []string expectedDrIds := []string{"DR_FREESWITCH_USERS"} - if err := rater.Call("ApierV1.GetTPDestinationRateIds", AttrTPDestinationRateIds{dr.TPid, utils.Paginator{Page: 0, ItemsPerPage: 0, SearchTerm: ""}}, &rplyDrIds); err != nil { + if err := rater.Call("ApierV1.GetTPDestinationRateIds", AttrTPDestinationRateIds{dr.TPid, utils.Paginator{}}, &rplyDrIds); err != nil { t.Error("Calling ApierV1.GetTPDestinationRateIds, got error: ", err.Error()) } else if !reflect.DeepEqual(expectedDrIds, rplyDrIds) { t.Errorf("Calling ApierV1.GetTPDestinationRateIds expected: %v, received: %v", expectedDrIds, rplyDrIds) @@ -436,7 +436,7 @@ func TestApierTPRatingPlan(t *testing.T) { // Test getIds var rplyRpIds []string expectedRpIds := []string{"RETAIL1"} - if err := rater.Call("ApierV1.GetTPRatingPlanIds", AttrGetTPRatingPlanIds{rp.TPid, utils.Paginator{Page: 0, ItemsPerPage: 0, SearchTerm: ""}}, &rplyRpIds); err != nil { + if err := rater.Call("ApierV1.GetTPRatingPlanIds", AttrGetTPRatingPlanIds{rp.TPid, utils.Paginator{}}, &rplyRpIds); err != nil { t.Error("Calling ApierV1.GetTPRatingPlanIds, got error: ", err.Error()) } else if !reflect.DeepEqual(expectedRpIds, rplyRpIds) { t.Errorf("Calling ApierV1.GetTPRatingPlanIds expected: %v, received: %v", expectedRpIds, rplyRpIds) @@ -1340,8 +1340,8 @@ func TestGetCallCostLog(t *testing.T) { } attrs.CgrId = "dummyid" attrs.RunId = "default" - if err := rater.Call("ApierV1.GetCallCostLog", attrs, &cc); err == nil || err.Error() != "SERVER_ERROR:Record Not Found" { - t.Error("ApierV1.GetCallCostLog: should return NOT_FOUND") + if err := rater.Call("ApierV1.GetCallCostLog", attrs, &cc); err == nil || err.Error() != "SERVER_ERROR:record not found" { + t.Error("ApierV1.GetCallCostLog: should return NOT_FOUND, got: %v", err) } } diff --git a/update_external_libs.sh b/update_external_libs.sh index 1a293d934..a35d80047 100755 --- a/update_external_libs.sh +++ b/update_external_libs.sh @@ -14,4 +14,5 @@ go get -u -v github.com/cgrates/gorm go get -u -v github.com/gorhill/cronexpr go get -u -v github.com/cgrates/kamevapi go get -u -v github.com/DisposaBoy/JsonConfigReader +go get -u -v golang.org/x/net/websocket