scrobblerlog: Allow configuring fallback time zone

Fixes #6
This commit is contained in:
Philipp Wolfer 2025-04-29 10:05:40 +02:00
parent 0f4b04c641
commit ed191d2f15
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
5 changed files with 68 additions and 22 deletions

View file

@ -33,3 +33,13 @@ func TestInitConfig(t *testing.T) {
err := backend.InitConfig(&service)
assert.NoError(t, err)
}
func TestInitConfigInvalidTimezone(t *testing.T) {
c := viper.New()
configuredTimezone := "Invalid/Timezone"
c.Set("time-zone", configuredTimezone)
service := config.NewServiceConfig("test", c)
backend := scrobblerlog.ScrobblerLogBackend{}
err := backend.InitConfig(&service)
assert.ErrorContains(t, err, `Invalid time-zone "Invalid/Timezone"`)
}