Skip to content

chore(internal): reformat some tests #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import org.junit.jupiter.api.Test
internal class ComparisonFilterTest {

@Test
fun createComparisonFilter() {
fun create() {
val comparisonFilter =
ComparisonFilter.builder()
.key("key")
.type(ComparisonFilter.Type.EQ)
.value("string")
.build()
assertThat(comparisonFilter).isNotNull

assertThat(comparisonFilter.key()).isEqualTo("key")
assertThat(comparisonFilter.type()).isEqualTo(ComparisonFilter.Type.EQ)
assertThat(comparisonFilter.value()).isEqualTo(ComparisonFilter.Value.ofString("string"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test
internal class CompoundFilterTest {

@Test
fun createCompoundFilter() {
fun create() {
val compoundFilter =
CompoundFilter.builder()
.addFilter(
Expand All @@ -20,7 +20,7 @@ internal class CompoundFilterTest {
)
.type(CompoundFilter.Type.AND)
.build()
assertThat(compoundFilter).isNotNull

assertThat(compoundFilter.filters())
.containsExactly(
CompoundFilter.Filter.ofComparison(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import org.junit.jupiter.api.Test
internal class ErrorObjectTest {

@Test
fun createErrorObject() {
fun create() {
val errorObject =
ErrorObject.builder()
.code("code")
.message("message")
.param("param")
.type("type")
.build()
assertThat(errorObject).isNotNull

assertThat(errorObject.code()).contains("code")
assertThat(errorObject.message()).isEqualTo("message")
assertThat(errorObject.param()).contains("param")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test
internal class FunctionDefinitionTest {

@Test
fun createFunctionDefinition() {
fun create() {
val functionDefinition =
FunctionDefinition.builder()
.name("name")
Expand All @@ -21,7 +21,7 @@ internal class FunctionDefinitionTest {
)
.strict(true)
.build()
assertThat(functionDefinition).isNotNull

assertThat(functionDefinition.name()).isEqualTo("name")
assertThat(functionDefinition.description()).contains("description")
assertThat(functionDefinition.parameters())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
package com.openai.models

import com.openai.core.JsonValue
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class FunctionParametersTest {

@Test
fun createFunctionParameters() {
fun create() {
val functionParameters =
FunctionParameters.builder().putAdditionalProperty("foo", JsonValue.from("bar")).build()
assertThat(functionParameters).isNotNull
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
package com.openai.models

import com.openai.core.JsonValue
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class MetadataTest {

@Test
fun createMetadata() {
fun create() {
val metadata =
Metadata.builder().putAdditionalProperty("foo", JsonValue.from("string")).build()
assertThat(metadata).isNotNull
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import org.junit.jupiter.api.Test
internal class ReasoningTest {

@Test
fun createReasoning() {
fun create() {
val reasoning =
Reasoning.builder()
.effort(ReasoningEffort.LOW)
.generateSummary(Reasoning.GenerateSummary.CONCISE)
.build()
assertThat(reasoning).isNotNull

assertThat(reasoning.effort()).contains(ReasoningEffort.LOW)
assertThat(reasoning.generateSummary()).contains(Reasoning.GenerateSummary.CONCISE)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

package com.openai.models

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class ResponseFormatJsonObjectTest {

@Test
fun createResponseFormatJsonObject() {
fun create() {
val responseFormatJsonObject = ResponseFormatJsonObject.builder().build()
assertThat(responseFormatJsonObject).isNotNull
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test
internal class ResponseFormatJsonSchemaTest {

@Test
fun createResponseFormatJsonSchema() {
fun create() {
val responseFormatJsonSchema =
ResponseFormatJsonSchema.builder()
.jsonSchema(
Expand All @@ -25,7 +25,7 @@ internal class ResponseFormatJsonSchemaTest {
.build()
)
.build()
assertThat(responseFormatJsonSchema).isNotNull

assertThat(responseFormatJsonSchema.jsonSchema())
.isEqualTo(
ResponseFormatJsonSchema.JsonSchema.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

package com.openai.models

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class ResponseFormatTextTest {

@Test
fun createResponseFormatText() {
fun create() {
val responseFormatText = ResponseFormatText.builder().build()
assertThat(responseFormatText).isNotNull
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test
internal class TranscriptionSegmentTest {

@Test
fun createTranscriptionSegment() {
fun create() {
val transcriptionSegment =
TranscriptionSegment.builder()
.id(0L)
Expand All @@ -22,7 +22,7 @@ internal class TranscriptionSegmentTest {
.text("text")
.addToken(0L)
.build()
assertThat(transcriptionSegment).isNotNull

assertThat(transcriptionSegment.id()).isEqualTo(0L)
assertThat(transcriptionSegment.avgLogprob()).isEqualTo(0.0)
assertThat(transcriptionSegment.compressionRatio()).isEqualTo(0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.junit.jupiter.api.Test
internal class TranscriptionTest {

@Test
fun createTranscription() {
fun create() {
val transcription = Transcription.builder().text("text").build()
assertThat(transcription).isNotNull

assertThat(transcription.text()).isEqualTo("text")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test
internal class TranscriptionVerboseTest {

@Test
fun createTranscriptionVerbose() {
fun create() {
val transcriptionVerbose =
TranscriptionVerbose.builder()
.duration(0.0)
Expand All @@ -31,7 +31,7 @@ internal class TranscriptionVerboseTest {
)
.addWord(TranscriptionWord.builder().end(0.0).start(0.0).word("word").build())
.build()
assertThat(transcriptionVerbose).isNotNull

assertThat(transcriptionVerbose.duration()).isEqualTo(0.0)
assertThat(transcriptionVerbose.language()).isEqualTo("language")
assertThat(transcriptionVerbose.text()).isEqualTo("text")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.junit.jupiter.api.Test
internal class TranscriptionWordTest {

@Test
fun createTranscriptionWord() {
fun create() {
val transcriptionWord = TranscriptionWord.builder().end(0.0).start(0.0).word("word").build()
assertThat(transcriptionWord).isNotNull

assertThat(transcriptionWord.end()).isEqualTo(0.0)
assertThat(transcriptionWord.start()).isEqualTo(0.0)
assertThat(transcriptionWord.word()).isEqualTo("word")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.junit.jupiter.api.Test
internal class TranslationTest {

@Test
fun createTranslation() {
fun create() {
val translation = Translation.builder().text("text").build()
assertThat(translation).isNotNull

assertThat(translation.text()).isEqualTo("text")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test
internal class TranslationVerboseTest {

@Test
fun createTranslationVerbose() {
fun create() {
val translationVerbose =
TranslationVerbose.builder()
.duration(0.0)
Expand All @@ -31,7 +31,7 @@ internal class TranslationVerboseTest {
.build()
)
.build()
assertThat(translationVerbose).isNotNull

assertThat(translationVerbose.duration()).isEqualTo(0.0)
assertThat(translationVerbose.language()).isEqualTo("language")
assertThat(translationVerbose.text()).isEqualTo("text")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import org.junit.jupiter.api.Test
internal class BatchErrorTest {

@Test
fun createBatchError() {
fun create() {
val batchError =
BatchError.builder().code("code").line(0L).message("message").param("param").build()
assertThat(batchError).isNotNull

assertThat(batchError.code()).contains("code")
assertThat(batchError.line()).contains(0L)
assertThat(batchError.message()).contains("message")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import org.junit.jupiter.api.Test
internal class BatchRequestCountsTest {

@Test
fun createBatchRequestCounts() {
fun create() {
val batchRequestCounts =
BatchRequestCounts.builder().completed(0L).failed(0L).total(0L).build()
assertThat(batchRequestCounts).isNotNull

assertThat(batchRequestCounts.completed()).isEqualTo(0L)
assertThat(batchRequestCounts.failed()).isEqualTo(0L)
assertThat(batchRequestCounts.total()).isEqualTo(0L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test
internal class BatchTest {

@Test
fun createBatch() {
fun create() {
val batch =
Batch.builder()
.id("id")
Expand Down Expand Up @@ -51,7 +51,7 @@ internal class BatchTest {
BatchRequestCounts.builder().completed(0L).failed(0L).total(0L).build()
)
.build()
assertThat(batch).isNotNull

assertThat(batch.id()).isEqualTo("id")
assertThat(batch.completionWindow()).isEqualTo("completion_window")
assertThat(batch.createdAt()).isEqualTo(0L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import org.junit.jupiter.api.Test
internal class AssistantDeletedTest {

@Test
fun createAssistantDeleted() {
fun create() {
val assistantDeleted = AssistantDeleted.builder().id("id").deleted(true).build()
assertThat(assistantDeleted).isNotNull

assertThat(assistantDeleted.id()).isEqualTo("id")
assertThat(assistantDeleted.deleted()).isEqualTo(true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test
internal class AssistantTest {

@Test
fun createAssistant() {
fun create() {
val assistant =
Assistant.builder()
.id("id")
Expand Down Expand Up @@ -44,7 +44,7 @@ internal class AssistantTest {
)
.topP(1.0)
.build()
assertThat(assistant).isNotNull

assertThat(assistant.id()).isEqualTo("id")
assertThat(assistant.createdAt()).isEqualTo(0L)
assertThat(assistant.description()).contains("description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

package com.openai.models.beta.assistants

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class CodeInterpreterToolTest {

@Test
fun createCodeInterpreterTool() {
fun create() {
val codeInterpreterTool = CodeInterpreterTool.builder().build()
assertThat(codeInterpreterTool).isNotNull
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test
internal class FileSearchToolTest {

@Test
fun createFileSearchTool() {
fun create() {
val fileSearchTool =
FileSearchTool.builder()
.fileSearch(
Expand All @@ -23,7 +23,7 @@ internal class FileSearchToolTest {
.build()
)
.build()
assertThat(fileSearchTool).isNotNull

assertThat(fileSearchTool.fileSearch())
.contains(
FileSearchTool.FileSearch.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test
internal class FunctionToolTest {

@Test
fun createFunctionTool() {
fun create() {
val functionTool =
FunctionTool.builder()
.function(
Expand All @@ -27,7 +27,7 @@ internal class FunctionToolTest {
.build()
)
.build()
assertThat(functionTool).isNotNull

assertThat(functionTool.function())
.isEqualTo(
FunctionDefinition.builder()
Expand Down
Loading