Updating tutorial2 files with Chargers and Attributes for it

This commit is contained in:
DanB
2020-02-05 19:59:19 +01:00
parent ffef415e8c
commit bf91053656
8 changed files with 45 additions and 12 deletions

View File

@@ -266,6 +266,32 @@ func testTutGetCost(t *testing.T) {
} else if *rply.Cost != 0.1 {
t.Errorf("Unexpected cost received: %f", *rply.Cost)
}
// reseller1 pricing for 1001->1002
attrs = v1.AttrGetCost{
Subject: "1001",
Destination: "1002",
AnswerTime: "*now",
Usage: "45s",
Category: "reseller1",
}
if err := tutRpc.Call(utils.APIerSv1GetCost, attrs, &rply); err != nil {
t.Error("Unexpected nil error received: ", err.Error())
} else if *rply.Cost != 0.1 {
t.Errorf("Unexpected cost received: %f", *rply.Cost)
}
// reseller1 pricing for 1001->1002 duration independent
attrs = v1.AttrGetCost{
Subject: "1001",
Destination: "1002",
AnswerTime: "*now",
Usage: "10m45s",
Category: "reseller1",
}
if err := tutRpc.Call(utils.APIerSv1GetCost, attrs, &rply); err != nil {
t.Error("Unexpected nil error received: ", err.Error())
} else if *rply.Cost != 0.1 {
t.Errorf("Unexpected cost received: %f", *rply.Cost)
}
}
func testTutAccounts(t *testing.T) {