mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
Add test to verify exporting and importing the secret key works
This commit is contained in:
15
src/imex.rs
15
src/imex.rs
@@ -1054,6 +1054,21 @@ mod tests {
|
|||||||
assert_eq!(bytes, key.to_asc(None).into_bytes());
|
assert_eq!(bytes, key.to_asc(None).into_bytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[async_std::test]
|
||||||
|
async fn test_export_and_import_key() {
|
||||||
|
let context = TestContext::new().await;
|
||||||
|
context.configure_alice().await;
|
||||||
|
let blobdir = "$BLOBDIR";
|
||||||
|
assert!(imex(&context.ctx, ImexMode::ExportSelfKeys, Some(blobdir))
|
||||||
|
.await
|
||||||
|
.is_ok());
|
||||||
|
|
||||||
|
let blobdir = context.ctx.get_blobdir().to_str().unwrap();
|
||||||
|
assert!(imex(&context.ctx, ImexMode::ImportSelfKeys, Some(blobdir))
|
||||||
|
.await
|
||||||
|
.is_ok());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_normalize_setup_code() {
|
fn test_normalize_setup_code() {
|
||||||
let norm = normalize_setup_code("123422343234423452346234723482349234");
|
let norm = normalize_setup_code("123422343234423452346234723482349234");
|
||||||
|
|||||||
Reference in New Issue
Block a user