Simple tests for Backend.FromConfig implementations

This commit is contained in:
Philipp Wolfer 2023-11-12 17:51:15 +01:00
parent aa01ae1342
commit c4ae2eda48
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
4 changed files with 61 additions and 0 deletions

View file

@ -25,11 +25,19 @@ import (
"testing"
"time"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"go.uploadedlobster.com/scotty/backends/funkwhale"
"go.uploadedlobster.com/scotty/models"
)
func TestFromConfig(t *testing.T) {
config := viper.New()
config.Set("token", "thetoken")
backend := funkwhale.FunkwhaleApiBackend{}.FromConfig(config)
assert.IsType(t, funkwhale.FunkwhaleApiBackend{}, backend)
}
func TestFunkwhaleListeningToListen(t *testing.T) {
fwListen := funkwhale.Listening{
CreationDate: "2023-11-09T23:59:29.022005Z",