X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftest%2FMocks.kt;h=65f279a30949da04dcd7796f49ccacb12d203827;hp=3b2c716358e0cab379510c66b8e10464629e4830;hb=07d3fa7dac96e8a5eff41487d647974df8c26f8d;hpb=f98ec5222b0611a7e473c01cb6ef3a4ef73bc294 diff --git a/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt b/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt index 3b2c716..65f279a 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Mocks.kt @@ -1,5 +1,5 @@ /** - * Sone - Mocks.kt - Copyright © 2019 David ‘Bombe’ Roden + * Sone - Mocks.kt - Copyright © 2019–2020 David ‘Bombe’ Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,8 @@ val remoteSone2 = createRemoteSone() val localSone1 = createLocalSone() val localSone2 = createLocalSone() +val createRequestUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyRandomSource(), "").uri +val createInsertUri: FreenetURI get() = InsertableClientSSK.createRandom(DummyRandomSource(), "").insertURI fun createId() = InsertableClientSSK.createRandom(DummyRandomSource(), "").uri.routingKey.asFreenetBase64 fun createLocalSone(id: String? = createId()) = object : IdOnlySone(id) { @@ -59,3 +61,6 @@ fun emptyPostReply(text: String = "", post: Post? = createPost(), sone: Sone = r override fun isKnown() = known override fun setKnown(known: Boolean): PostReply = this } + +fun createImage(sone: Sone): Image = + ImageImpl().modify().setSone(sone).update()