Fix httpagent integration test

This commit is contained in:
Trial97
2018-12-16 11:34:06 +02:00
committed by Dan Christian Bogos
parent 53a2b87f59
commit d4494b9a9e

View File

@@ -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) {