mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-05 20:44:35 +02:00
Begin unit tests, relates to #35
This commit is contained in:
parent
da8f90d388
commit
be50af0a7a
11 changed files with 198 additions and 61 deletions
server
23
server/cache_sqlite_test.go
Normal file
23
server/cache_sqlite_test.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSqliteCache_AddMessage(t *testing.T) {
|
||||
testCacheMessages(t, newSqliteTestCache(t))
|
||||
}
|
||||
|
||||
func TestSqliteCache_MessagesTagsPrioAndTitle(t *testing.T) {
|
||||
testCacheMessagesTagsPrioAndTitle(t, newSqliteTestCache(t))
|
||||
}
|
||||
|
||||
func newSqliteTestCache(t *testing.T) cache {
|
||||
filename := filepath.Join(t.TempDir(), "cache.db")
|
||||
c, err := newSqliteCache(filename)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return c
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue