mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fix httpagent integration test
This commit is contained in:
committed by
Dan Christian Bogos
parent
53a2b87f59
commit
d4494b9a9e
@@ -193,20 +193,16 @@ func testHAitAuth1001(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
var eXml []byte
|
||||
if t := time.Now(); t.Weekday() != 6 && t.Weekday() != 7 { // Different rating plans for weekend
|
||||
eXml = []byte(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<Allow>1</Allow>
|
||||
<MaxDuration>6042</MaxDuration>
|
||||
</response>`)
|
||||
} else {
|
||||
eXml = []byte(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<Allow>1</Allow>
|
||||
<MaxDuration>10800</MaxDuration>
|
||||
</response>`)
|
||||
// var eXml []byte
|
||||
maxDuration := 6042
|
||||
if t := time.Now(); t.Weekday() == time.Saturday || t.Weekday() == time.Sunday { // Different rating plans for weekend
|
||||
maxDuration = 10800
|
||||
}
|
||||
eXml := []byte(fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<Allow>1</Allow>
|
||||
<MaxDuration>%v</MaxDuration>
|
||||
</response>`, maxDuration))
|
||||
if body, err := ioutil.ReadAll(rply.Body); err != nil {
|
||||
t.Error(err)
|
||||
} else if !reflect.DeepEqual(eXml, body) {
|
||||
|
||||
Reference in New Issue
Block a user