fix: correct intended use for entity state
This commit is contained in:
@@ -173,22 +173,17 @@ mod tests {
|
|||||||
.with_attribute("int", Value::SignedInt(50))
|
.with_attribute("int", Value::SignedInt(50))
|
||||||
.with_attribute("string", Value::Text("text".to_string()));
|
.with_attribute("string", Value::Text("text".to_string()));
|
||||||
let id = entity.id.clone();
|
let id = entity.id.clone();
|
||||||
|
let expected_entity = Entity {
|
||||||
|
state: EntityState::Loaded,
|
||||||
|
..entity.clone()
|
||||||
|
};
|
||||||
catalog.insert(entity);
|
catalog.insert(entity);
|
||||||
catalog.persist();
|
catalog.persist();
|
||||||
// read the entity in a new catalog
|
// read the entity in a new catalog
|
||||||
let mut catalog = Catalog::new(path);
|
let mut catalog = Catalog::new(path);
|
||||||
catalog.load_by_id(&id);
|
catalog.load_by_id(&id);
|
||||||
let entity: Option<Entity> = catalog.get(&id);
|
let entity: Entity = catalog.get(&id).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(expected_entity, entity,);
|
||||||
entity,
|
|
||||||
Some(
|
|
||||||
Entity::default()
|
|
||||||
.with_id(&id)
|
|
||||||
.with_class("test")
|
|
||||||
.with_attribute("int", Value::SignedInt(50))
|
|
||||||
.with_attribute("string", Value::Text("text".to_string()))
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn check_011() {
|
fn check_011() {
|
||||||
|
|||||||
Reference in New Issue
Block a user