Fix some remote tests

This commit is contained in:
Mikołaj Pich 2020-11-11 17:10:15 +01:00
parent 64781b74e2
commit bdc0083ac5

View file

@ -1,5 +1,6 @@
package io.github.wulkanowy.sdk.scrapper package io.github.wulkanowy.sdk.scrapper
import io.github.wulkanowy.sdk.scrapper.attendance.AttendanceCategory
import io.github.wulkanowy.sdk.scrapper.messages.Folder import io.github.wulkanowy.sdk.scrapper.messages.Folder
import io.github.wulkanowy.sdk.scrapper.messages.Recipient import io.github.wulkanowy.sdk.scrapper.messages.Recipient
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
@ -33,7 +34,7 @@ class ScrapperRemoteTest : BaseTest() {
classId = 1 classId = 1
androidVersion = "9.0" androidVersion = "9.0"
buildTag = "Wulkanowy" buildTag = "Wulkanowy"
addInterceptor(Interceptor { addInterceptor({
println("Request event ${it.request().url().host()}") println("Request event ${it.request().url().host()}")
it.proceed(it.request()) it.proceed(it.request())
}, true) }, true)
@ -67,11 +68,12 @@ class ScrapperRemoteTest : BaseTest() {
students[0].run { students[0].run {
assertEquals("powiatwulkanowy", symbol) assertEquals("powiatwulkanowy", symbol)
assertEquals("jan@fakelog.cf", email) assertEquals("jan@fakelog.cf", email)
assertEquals("Jan Kowalski", studentName) assertEquals("Jan", studentName)
assertEquals("Kowalski", studentSurname)
assertEquals("123456", schoolSymbol) assertEquals("123456", schoolSymbol)
assertEquals(1, studentId) assertEquals(1, studentId)
assertEquals(1, classId) assertEquals(1, classId)
assertEquals("4A", className) assertEquals("A", className)
assertEquals("Publiczna szkoła Wulkanowego nr 1 w fakelog.cf", schoolName) assertEquals("Publiczna szkoła Wulkanowego nr 1 w fakelog.cf", schoolName)
} }
} }
@ -115,18 +117,18 @@ class ScrapperRemoteTest : BaseTest() {
assertEquals("Zajęcia z wychowawcą", subject) assertEquals("Zajęcia z wychowawcą", subject)
assertEquals(getDate(2018, 10, 1), date) assertEquals(getDate(2018, 10, 1), date)
assertEquals("Obecność", category.name) assertEquals(AttendanceCategory.PRESENCE, category)
} }
attendance[1].run { attendance[1].run {
assertEquals("Nieobecność nieusprawiedliwiona", category.name) assertEquals(AttendanceCategory.ABSENCE_UNEXCUSED, category)
} }
assertEquals("Nieobecność nieusprawiedliwiona", attendance[3].category.name) assertEquals(AttendanceCategory.ABSENCE_UNEXCUSED, attendance[3].category)
assertEquals("Nieobecność nieusprawiedliwiona", attendance[4].category.name) assertEquals(AttendanceCategory.ABSENCE_UNEXCUSED, attendance[4].category)
assertEquals("Nieobecność usprawiedliwiona", attendance[5].category.name) assertEquals(AttendanceCategory.ABSENCE_EXCUSED, attendance[5].category)
assertEquals("Spóźnienie nieusprawiedliwione", attendance[6].category.name) assertEquals(AttendanceCategory.UNEXCUSED_LATENESS, attendance[6].category)
assertEquals("Obecność", attendance[9].category) assertEquals(AttendanceCategory.PRESENCE, attendance[9].category)
} }
@Test @Test