Skip to content

Commit

Permalink
tests upd
Browse files Browse the repository at this point in the history
  • Loading branch information
LbP22 committed Apr 29, 2024
1 parent 164e225 commit 09e5289
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/backend/app/containerdb/containerdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ func TestGetLogs(t *testing.T) {
PutLogMessage(db, "Test", "TestGetLogsCont", []string{vars.Year + "-02-10T12:53:09.230421754Z", "fasdf\r\n"})
PutLogMessage(db, "Test", "TestGetLogsCont", []string{vars.Year + "-02-10T12:54:09.230421754Z", "fasdf\r\n"})
db.Close()
logs := GetLogs(false, true, "Test", "TestGetLogsCont", "", 30, vars.Year+"-02-10T12:57:09.230421754Z", false)

var logs [][]string
logs = GetLogs(false, true, "Test", "TestGetLogsCont", "", 30, vars.Year+"-02-10T12:57:09.230421754Z", false)["logs"].([][]string)
if len(logs) != 5 {
t.Error("5 logItems must be returned!")
}
if logs[0][0] != vars.Year+"-02-10T12:57:09.230421754Z" {
t.Error("Invalid first logItem datetime: ", logs[0][0])
}

logs = GetLogs(true, false, "Test", "TestGetLogsCont", "", 30, vars.Year+"-02-10T12:51:09.230421754Z", false)
logs = GetLogs(true, false, "Test", "TestGetLogsCont", "", 30, vars.Year+"-02-10T12:51:09.230421754Z", false)["logs"].([][]string)
if len(logs) != 4 {
t.Error("4 logItems must be returned!")
}
Expand Down

0 comments on commit 09e5289

Please sign in to comment.