Add more tests

This commit is contained in:
Jeff Mitchell
2016-05-07 21:08:13 -04:00
parent 8672b61bef
commit fd67b15bb0
5 changed files with 61 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"strings"
"testing"
"time"
"errors"
@@ -26,6 +27,7 @@ func TestFormatJSON_formatRequest(t *testing.T) {
Connection: &logical.Connection{
RemoteAddr: "127.0.0.1",
},
WrapTTL: 60 * time.Second,
},
errors.New("this is an error"),
testFormatJSONReqBasicStr,
@@ -64,5 +66,5 @@ func TestFormatJSON_formatRequest(t *testing.T) {
}
}
const testFormatJSONReqBasicStr = `{"time":"2015-08-05T13:45:46Z","type":"request","auth":{"display_name":"","policies":["root"],"metadata":null},"request":{"operation":"update","path":"/foo","data":null,"remote_address":"127.0.0.1"},"error":"this is an error"}
const testFormatJSONReqBasicStr = `{"time":"2015-08-05T13:45:46Z","type":"request","auth":{"display_name":"","policies":["root"],"metadata":null},"request":{"operation":"update","path":"/foo","data":null,"wrap_ttl":60,"remote_address":"127.0.0.1"},"error":"this is an error"}
`