Revert runTest because the wait to get results back fails in the function
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ suspend fun INostrClient.sendAndWaitForResponse(
|
||||
val currentResult = receivedResults[result.relay]
|
||||
// do not override a successful result.
|
||||
if (currentResult == null || !currentResult) {
|
||||
receivedResults.put(result.relay, result.success)
|
||||
receivedResults[result.relay] = result.success
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -30,14 +30,14 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class NostrClientSendAndWaitTest : BaseNostrClientTest() {
|
||||
@Test
|
||||
fun testSendAndWaitForResponse() =
|
||||
runTest {
|
||||
runBlocking {
|
||||
val appScope = CoroutineScope(Dispatchers.Default + SupervisorJob())
|
||||
val client = NostrClient(socketBuilder, appScope)
|
||||
|
||||
@@ -61,6 +61,6 @@ class NostrClientSendAndWaitTest : BaseNostrClientTest() {
|
||||
appScope.cancel()
|
||||
|
||||
assertEquals(true, resultDamus)
|
||||
assertEquals(false, resultNos)
|
||||
assertEquals(true, resultNos)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user