A Telegram Bot for collecting the photos of your children
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
650 B

package main
import (
"os"
"path/filepath"
"testing"
)
func TestSanitizeAlbumName(t *testing.T) {
input := "Mes premières années"
want := "mes-premieres-annees"
if got := sanitizeAlbumName(input); got != want {
t.Errorf("sanitizeAlbumName() = %q, want %q", got, want)
}
}
func TestNewMediaStore(t *testing.T) {
tmp := createTempDir(t)
defer tmp.cleanup(t)
_, err := InitMediaStore(tmp.RootDir)
if err != nil {
t.Errorf("InitMediaStore(): error %s", err)
}
stat, err := os.Stat(filepath.Join(tmp.RootDir, ".current"))
if err != nil || !stat.IsDir() {
t.Errorf("InitMediaStore(): .current not created (error = %s)", err)
}
}