@@ -32,6 +32,10 @@ impl EntryViewer {
|
||||
&self.document
|
||||
}
|
||||
|
||||
pub fn into_document(self) -> EntryDocument {
|
||||
self.document
|
||||
}
|
||||
|
||||
pub fn focused_index(&self) -> Option<usize> {
|
||||
(!self.document.fields().is_empty()).then_some(self.focused)
|
||||
}
|
||||
@@ -120,7 +124,7 @@ impl fmt::Debug for EntryViewer {
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod test_support {
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use ironstorage::{
|
||||
crypto::{KeyInfo, KeyStore, SecretProvider, SecretProviderError},
|
||||
@@ -144,7 +148,13 @@ pub(crate) mod test_support {
|
||||
pub(crate) fn fixture_document(entry: &str) -> EntryDocument {
|
||||
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../crates/storage/tests/fixtures/compatibility");
|
||||
let repository = Repository::open(root.join("stores/basic")).expect("fixture repository");
|
||||
fixture_document_from(&root.join("stores/basic"), entry)
|
||||
}
|
||||
|
||||
pub(crate) fn fixture_document_from(store: &Path, entry: &str) -> EntryDocument {
|
||||
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("../../crates/storage/tests/fixtures/compatibility");
|
||||
let repository = Repository::open(store).expect("fixture repository");
|
||||
let keys = KeyStore::load(root.join("keys")).expect("fixture keys");
|
||||
EntryDocumentService::new(&repository, &keys)
|
||||
.open(entry, &mut FixtureSecrets)
|
||||
|
||||
Reference in New Issue
Block a user