Fix tests

This commit is contained in:
Steve Soltys 2024-06-06 18:21:14 -04:00
parent eb5e03a79c
commit 797f8b9e61

View file

@ -14,6 +14,12 @@ import org.junit.Test
@LargeTest @LargeTest
internal class BackupRestoreTest : SeedvaultLargeTest() { internal class BackupRestoreTest : SeedvaultLargeTest() {
companion object {
private val IGNORED_KV_DATA = mapOf(
"@pm@" to setOf("@meta@")
)
}
@Test @Test
fun `backup and restore applications`() { fun `backup and restore applications`() {
launchBackupActivity() launchBackupActivity()
@ -132,12 +138,14 @@ internal class BackupRestoreTest : SeedvaultLargeTest() {
} }
kvData.forEach { (key, value) -> kvData.forEach { (key, value) ->
assert(backup.kv[pkg]!!.containsKey(key)) { if(IGNORED_KV_DATA[pkg]?.contains(key) == false) {
"KV data for $pkg/$key exists in restore but is missing from backup." assert(backup.kv[pkg]!!.containsKey(key)) {
} "KV data for $pkg/$key exists in restore but is missing from backup."
}
assert(value.contentEquals(backup.kv[pkg]!![key]!!)) { assert(value.contentEquals(backup.kv[pkg]!![key]!!)) {
"KV data for $pkg/$key does not match." "KV data for $pkg/$key does not match."
}
} }
} }
} }