More work on project permissions

This commit is contained in:
simon987
2019-02-16 11:47:54 -05:00
parent 03153c4d39
commit e079fc8497
18 changed files with 470 additions and 125 deletions

View File

@@ -18,7 +18,7 @@ func TestTraceValid(t *testing.T) {
Scope: "test",
Message: "This is a test message",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode != 200 {
t.Fail()
@@ -30,7 +30,7 @@ func TestTraceInvalidScope(t *testing.T) {
r := Post("/log/trace", api.LogRequest{
Message: "this is a test message",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode == 200 {
t.Error()
@@ -40,7 +40,7 @@ func TestTraceInvalidScope(t *testing.T) {
Scope: "",
Message: "this is a test message",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode == 200 {
t.Error()
@@ -56,7 +56,7 @@ func TestTraceInvalidMessage(t *testing.T) {
Scope: "test",
Message: "",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode == 200 {
t.Error()
@@ -71,7 +71,7 @@ func TestTraceInvalidTime(t *testing.T) {
r := Post("/log/trace", api.LogRequest{
Scope: "test",
Message: "test",
}, w)
}, w, nil)
if r.StatusCode == 200 {
t.Error()
}
@@ -87,7 +87,7 @@ func TestWarnValid(t *testing.T) {
Scope: "test",
Message: "test",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode != 200 {
t.Fail()
}
@@ -100,7 +100,7 @@ func TestInfoValid(t *testing.T) {
Scope: "test",
Message: "test",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode != 200 {
t.Fail()
}
@@ -113,7 +113,7 @@ func TestErrorValid(t *testing.T) {
Scope: "test",
Message: "test",
TimeStamp: time.Now().Unix(),
}, w)
}, w, nil)
if r.StatusCode != 200 {
t.Fail()
}
@@ -179,7 +179,7 @@ func getLogs(since int64, level storage.LogLevel) *api.GetLogResponse {
r := Post(fmt.Sprintf("/logs"), api.GetLogRequest{
Since: since,
Level: level,
}, nil)
}, nil, nil)
resp := &api.GetLogResponse{}
data, _ := ioutil.ReadAll(r.Body)