Add default entry by simply creating an empty Entry
This commit is contained in:
parent
8904694b2a
commit
a3d923ab20
1 changed files with 4 additions and 3 deletions
|
@ -229,7 +229,7 @@ mod tests {
|
|||
|
||||
use libimagrt::runtime::Runtime;
|
||||
use libimagstore::storeid::StoreId;
|
||||
use libimagstore::store::{Result as StoreResult, FileLockEntry};
|
||||
use libimagstore::store::{Result as StoreResult, FileLockEntry, Entry};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
@ -240,15 +240,16 @@ mod tests {
|
|||
with help "imag-tag mocking app";
|
||||
}
|
||||
use self::mock::generate_test_runtime;
|
||||
use libimagutil::testing::DEFAULT_ENTRY;
|
||||
|
||||
fn create_test_default_entry<'a, S: AsRef<OsStr>>(rt: &'a Runtime, name: S) -> StoreResult<StoreId> {
|
||||
let mut path = PathBuf::new();
|
||||
path.set_file_name(name);
|
||||
|
||||
let default_entry = Entry::new(StoreId::new_baseless(PathBuf::from("")).unwrap()).to_str();
|
||||
|
||||
let id = StoreId::new_baseless(path)?;
|
||||
let mut entry = rt.store().create(id.clone())?;
|
||||
entry.get_content_mut().push_str(DEFAULT_ENTRY);
|
||||
entry.get_content_mut().push_str(&default_entry);
|
||||
|
||||
Ok(id)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue