Add domain test
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package org.koitharu.kotatsu.parsers
|
||||
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import okhttp3.HttpUrl
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Disabled
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
import org.junit.jupiter.params.ParameterizedTest
|
||||
@@ -123,6 +125,20 @@ internal class MangaParserTest {
|
||||
checkImageRequest(faviconUrl, null)
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MangaSources
|
||||
fun domain(source: MangaSource) = runTest {
|
||||
val parser = source.newParser(context)
|
||||
val defaultDomain = parser.getDomain()
|
||||
val url = HttpUrl.Builder()
|
||||
.host(defaultDomain)
|
||||
.scheme("https")
|
||||
.toString()
|
||||
val response = context.doRequest(url)
|
||||
val realDomain = response.request.url.host
|
||||
assertEquals(defaultDomain, realDomain)
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MangaSources
|
||||
@Disabled
|
||||
|
||||
Reference in New Issue
Block a user