-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(api): Update test assertion for ChatCompletionChunkTest
Adjust test assertion values to reflect changes in Chunk model.
- Loading branch information
Showing
3 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...lient-core/src/jvmTest/kotlin/com/tddworks/openai/api/chat/api/ChatCompletionChunkTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.tddworks.openai.api.chat.api | ||
|
||
import org.junit.jupiter.api.Assertions.* | ||
import org.junit.jupiter.api.Test | ||
|
||
class ChatCompletionChunkTest { | ||
|
||
@Test | ||
fun `should create dummy chunk`() { | ||
val chunk = ChatCompletionChunk.dummy() | ||
assertEquals("fake-id", chunk.id) | ||
assertEquals("text", chunk.`object`) | ||
assertEquals(0, chunk.created) | ||
assertEquals("fake-model", chunk.model) | ||
assertEquals(1, chunk.choices.size) | ||
assertEquals(ChatChunk.fake(), chunk.choices[0]) | ||
assertEquals("fake-content", chunk.content()) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../openai-gateway-core/src/jvmTest/kotlin/com/tddworks/anthropic/api/AnthropicConfigTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.tddworks.anthropic.api | ||
|
||
import org.junit.jupiter.api.Assertions.assertNotNull | ||
import org.junit.jupiter.api.Test | ||
import org.koin.core.context.startKoin | ||
import org.koin.test.junit5.AutoCloseKoinTest | ||
|
||
class AnthropicConfigTest : AutoCloseKoinTest() { | ||
|
||
@Test | ||
fun `fix the coverage by this case`() { | ||
startKoin { | ||
val r = AnthropicConfig().getKoin() | ||
assertNotNull(r) | ||
} | ||
} | ||
} |