From f3a0a3288ce05d968e4a7df48bb107eff4ffd5fb Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Tue, 28 Nov 2023 13:25:31 +0800 Subject: [PATCH] test(komga): fix epub tests --- .../gotson/komga/infrastructure/mediacontainer/epub/NavTest.kt | 3 ++- .../gotson/komga/infrastructure/mediacontainer/epub/NcxTest.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NavTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NavTest.kt index 23019957d..562705dc0 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NavTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NavTest.kt @@ -7,6 +7,7 @@ import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource import org.springframework.core.io.ClassPathResource import java.util.stream.Stream +import kotlin.io.path.Path class NavTest { @ParameterizedTest @@ -17,7 +18,7 @@ class NavTest { val navString = navResource.inputStream.readAllBytes().decodeToString() // when - val nav = processNav(navString, navType) + val nav = processNav(ResourceContent(Path("${prefix?.let { "$it/" }}nav.xhtml"), navString), navType) // then val expectedNav = expectedProvider(prefix?.let { "$it/" } ?: "") diff --git a/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NcxTest.kt b/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NcxTest.kt index fa86f0f6a..ebb549ab4 100644 --- a/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NcxTest.kt +++ b/komga/src/test/kotlin/org/gotson/komga/infrastructure/mediacontainer/epub/NcxTest.kt @@ -7,6 +7,7 @@ import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.MethodSource import org.springframework.core.io.ClassPathResource import java.util.stream.Stream +import kotlin.io.path.Path class NcxTest { @ParameterizedTest @@ -17,7 +18,7 @@ class NcxTest { val ncxString = ncxResource.inputStream.readAllBytes().decodeToString() // when - val ncxNav = processNcx(ncxString, navType) + val ncxNav = processNcx(ResourceContent(Path("${prefix?.let { "$it/" }}toc.ncx"), ncxString), navType) // then val expectedNav = expectedProvider(prefix?.let { "$it/" } ?: "")