Inventaire import: manage case where author does not exist

This commit is contained in:
2026-03-15 15:57:34 +01:00
parent be5be81cbd
commit 67c475f14c
2 changed files with 30 additions and 6 deletions

View File

@@ -132,6 +132,27 @@ func TestCallInventaireEdition(t *testing.T) {
result)
}
func TestCalInventaireEditionNoAuthor(t *testing.T) {
result, err := CallInventaireEdition(getBaseInventaireUrl(), "isbn:9782226487162", "fr")
if err != nil {
t.Error(err)
}
assert.Equal(t,
InventaireEditionDetailedSingleResult{
Id: "isbn:9782226487162",
Title: "Les Yeux de Mona",
Author: nil,
Description: "",
ISBN: "978-2-226-48716-2",
Publisher: "éditions Albin Michel",
ReleaseDate: "2024-02-01",
Image: "https://inventaire.io/img/entities/3ca857913983d694be03dee712bb2af9e2c51747",
Lang: "fr",
},
result)
}
func TestCallInventaireEditionFromISBN(t *testing.T) {
result, err := CallInventaireFromISBN(getBaseInventaireUrl(), "9782070379248", "fr")
if err != nil {