Skip to content

Commit

Permalink
Removed Test that expected an Exception caused by the use of invalid …
Browse files Browse the repository at this point in the history
…Snowflakes, which can no longer be constructed
  • Loading branch information
lukellmann committed Aug 31, 2021
1 parent b70ee31 commit b96f3bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
4 changes: 1 addition & 3 deletions core/src/main/kotlin/Kord.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dev.kord.core
import dev.kord.cache.api.DataCache
import dev.kord.common.annotation.DeprecatedSinceKord
import dev.kord.common.annotation.KordExperimental
import dev.kord.common.annotation.KordPreview
import dev.kord.common.annotation.KordUnsafe
import dev.kord.common.entity.DiscordShard
import dev.kord.common.entity.PresenceStatus
Expand Down Expand Up @@ -211,7 +210,6 @@ class Kord(
* returns null if the [Channel] isn't present.
*
* @throws [RequestException] if anything went wrong during the request.
* @throws [EntityNotFoundException] if the channel wasn't present.
*/
suspend fun getChannel(
id: Snowflake,
Expand Down Expand Up @@ -299,9 +297,9 @@ class Kord(

/**
* Requests to get the [User] that with the [id] through the [strategy],
* returns null if the [User] isn't present.
*
* @throws [RequestException] if anything went wrong during the request.
* @throws [EntityNotFoundException] if the user wasn't present.
*/
suspend fun getUser(id: Snowflake, strategy: EntitySupplyStrategy<*> = resources.defaultStrategy): User? =
strategy.supply(this).getUserOrNull(id)
Expand Down
14 changes: 1 addition & 13 deletions core/src/test/kotlin/rest/RestTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import dev.kord.core.behavior.channel.*
import dev.kord.core.behavior.channel.threads.edit
import dev.kord.core.entity.Guild
import dev.kord.core.entity.ReactionEmoji
import dev.kord.core.entity.channel.TopGuildMessageChannel
import dev.kord.core.entity.channel.TextChannel
import dev.kord.core.entity.channel.TopGuildMessageChannel
import dev.kord.core.entity.channel.createInvite
import dev.kord.rest.Image
import dev.kord.rest.builder.interaction.group
import dev.kord.rest.builder.interaction.int
import dev.kord.rest.builder.interaction.subCommand
import dev.kord.rest.request.RequestHandler
import dev.kord.rest.request.RestRequestException
import kotlinx.coroutines.flow.filterIsInstance
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.toList
Expand Down Expand Up @@ -384,17 +383,6 @@ class RestServiceTest {
}

@Test
@Order(21)
fun `errors are thrown correctly`() = runBlocking {
val exception = assertThrows<RestRequestException> {
runBlocking { kord.getChannel(Snowflake((-500).toULong())) }
}

assert(exception.error != null)
}

@Test

@Order(21)
fun `category channel creation`(): Unit = runBlocking {
val category = guild.createCategory("my category")
Expand Down

0 comments on commit b96f3bb

Please sign in to comment.