Skip to content

Commit

Permalink
Move invite test to rest, Fix image from binary
Browse files Browse the repository at this point in the history
  • Loading branch information
BartArys committed Jun 25, 2020
1 parent 6be7bd5 commit 10030e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
22 changes: 0 additions & 22 deletions core/src/test/kotlin/InviteTests.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ fun image(path: String): String {
return "data:image/$imageType;base64, $encoded"
}

fun imageBinary(path: String) : Image {
fun imageBinary(path: String): Image {
val loader = Unit::class.java.classLoader
val image = loader?.getResource(path)?.readBytes()
val imageType = path.split(".").last()
val format = Image.Format.fromContentType(imageType)
val format = Image.Format.fromContentType("image/$imageType")
return Image.raw(image!!, format)
}

Expand Down Expand Up @@ -98,7 +98,9 @@ class RestServiceTest {
fun `create invite`() = runBlocking {
val generalId = rest.guild.getGuildChannels(guildId).first { it.type == ChannelType.GuildText }.id

rest.channel.createInvite(generalId)
val invite = rest.channel.createInvite(generalId)

rest.invite.getInvite(invite.code, true)

Unit
}
Expand Down

0 comments on commit 10030e0

Please sign in to comment.