mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 21:57:06 +02:00
Reduced redundancy in model conversions and consistent naming
This commit is contained in:
parent
e29d8e2a63
commit
cac88f316b
10 changed files with 107 additions and 107 deletions
|
@ -34,7 +34,7 @@ func TestFromConfig(t *testing.T) {
|
|||
assert.IsType(t, &funkwhale.FunkwhaleApiBackend{}, backend)
|
||||
}
|
||||
|
||||
func TestFunkwhaleListeningToListen(t *testing.T) {
|
||||
func TestFunkwhaleListeningAsListen(t *testing.T) {
|
||||
fwListen := funkwhale.Listening{
|
||||
CreationDate: "2023-11-09T23:59:29.022005Z",
|
||||
User: funkwhale.User{
|
||||
|
@ -61,7 +61,7 @@ func TestFunkwhaleListeningToListen(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
listen := fwListen.ToListen()
|
||||
listen := fwListen.AsListen()
|
||||
assert := assert.New(t)
|
||||
assert.Equal(time.Unix(1699574369, 0).Unix(), listen.ListenedAt.Unix())
|
||||
assert.Equal(fwListen.User.UserName, listen.UserName)
|
||||
|
@ -79,7 +79,7 @@ func TestFunkwhaleListeningToListen(t *testing.T) {
|
|||
assert.Equal(funkwhale.FunkwhaleClientName, listen.AdditionalInfo["media_player"])
|
||||
}
|
||||
|
||||
func TestFunkwhaleFavoriteTrackToLove(t *testing.T) {
|
||||
func TestFunkwhaleFavoriteTrackAsLove(t *testing.T) {
|
||||
favorite := funkwhale.FavoriteTrack{
|
||||
CreationDate: "2023-11-09T23:59:29.022005Z",
|
||||
User: funkwhale.User{
|
||||
|
@ -106,7 +106,7 @@ func TestFunkwhaleFavoriteTrackToLove(t *testing.T) {
|
|||
},
|
||||
},
|
||||
}
|
||||
love := favorite.ToLove()
|
||||
love := favorite.AsLove()
|
||||
assert := assert.New(t)
|
||||
assert.Equal(time.Unix(1699574369, 0).Unix(), love.Created.Unix())
|
||||
assert.Equal(favorite.User.UserName, love.UserName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue