Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuth committed Sep 29, 2024
1 parent c46d11e commit 2acb575
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/test/kotlin/de/gmuth/ipp/client/IppJobTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,10 @@ class IppJobTests {
job.cupsGetDocuments(save = true, directory = createTempDirectory().toFile())
}

@Test
fun cupsGetDocumentsWithoutSaving() {
ippClientMock.mockResponse(cupsDocumentResponse("application/postscript"))
job.cupsGetDocuments()
}

}
6 changes: 6 additions & 0 deletions src/test/kotlin/de/gmuth/ipp/core/IppAttributesGroupTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package de.gmuth.ipp.core
import de.gmuth.ipp.core.IppAttributesGroup.Companion.replaceEnabled
import de.gmuth.ipp.core.IppTag.*
import java.io.File
import java.io.PrintWriter
import java.time.ZoneId
import java.util.logging.Logger.getLogger
import kotlin.test.Test
Expand Down Expand Up @@ -137,6 +138,11 @@ class IppAttributesGroupTests {
group.saveText(File.createTempFile("tempfiles", ".tmp"))
}

@Test
fun writeAttributesWithoutTitle() {
group.writeText(PrintWriter(java.lang.System.out), null)
}

// ------------- interface Map methods ------------

@Test
Expand Down
7 changes: 6 additions & 1 deletion src/test/kotlin/de/gmuth/ipp/core/IppMessageTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ class IppMessageTests {
assertEquals("codeDescription []", message.toString())
message.log(logger)
assertFailsWith<IppException> { // missing raw bytes
message.saveBytes(createTempFile("test", null))
message.saveBytes(createTempFile("rawbytes", null))
}
}

@Test
fun writeTest() {
message.saveText(createTempFile("text", null))
}

}

0 comments on commit 2acb575

Please sign in to comment.