diff options
Diffstat (limited to 'service_report_test.go')
| -rw-r--r-- | service_report_test.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/service_report_test.go b/service_report_test.go index 71652f6..95fc27d 100644 --- a/service_report_test.go +++ b/service_report_test.go @@ -4,14 +4,31 @@ package lilin import ( + "os" "testing" "time" "git.sr.ht/~shulhan/pakakeh.go/lib/test" ) -func TestServiceReport_push(t *testing.T) { - var svcReport = NewServiceReport(`test`) +func TestServiceReport_Store(t *testing.T) { + var serverOpts = ServerOptions{ + BaseDir: `testdata`, + } + var err = serverOpts.init() + if err != nil { + t.Fatal(err) + } + + var svcReport *ServiceReport + svcReport, err = NewServiceReport(serverOpts, `testStore`) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { + _ = os.Remove(svcReport.logPath) + }) + var x int64 for x = 1; x <= historyMax+1; x++ { svcReport.Store(ScanReport{At: time.Unix(x, 0)}) |
