Readded add with bad field name test.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
parent
3fd6bafd33
commit
f69d5d2248
@ -4467,6 +4467,10 @@ mod document_files {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_docdef(&self) -> &DocDef {
|
||||
&self.docdef
|
||||
}
|
||||
|
||||
fn get_docdef_mut(&mut self) -> &mut DocDef {
|
||||
&mut self.docdef
|
||||
}
|
||||
@ -4704,26 +4708,26 @@ mod document_files {
|
||||
assert!(entries.is_empty(), "did not use {:?}", entries);
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn errors_on_wrong_field_name() {
|
||||
let (docdef, doc_name) = create_docdef([FieldType::Uuid].to_vec());
|
||||
let field_name = Uuid::new_v4().to_string();
|
||||
let (queue, rx) = test_doc(doc_name.as_str(), docdef, standard_routes());
|
||||
let mut test_doc = TestDocument::new(Vec::new());
|
||||
test_doc.start();
|
||||
let queue = test_doc.get_queue();
|
||||
let name = Name::english("bad".to_string());
|
||||
let mut addition = Addition::new();
|
||||
addition.add_field(field_name.clone(), Uuid::new_v4());
|
||||
let msg = Message::new(doc_name, addition);
|
||||
queue.send(msg).unwrap();
|
||||
let result = rx.recv_timeout(TIMEOUT).unwrap();
|
||||
addition.add_field(name.clone(), "doesn't matter");
|
||||
queue.send(Message::new(test_doc.get_docdef().get_document_name(), addition)).unwrap();
|
||||
let result = test_doc.get_receiver().recv_timeout(TIMEOUT).unwrap();
|
||||
match result.get_action() {
|
||||
MsgAction::Error(err) => match err {
|
||||
MTTError::DocumentFieldNotFound(data) => assert_eq!(data, &field_name),
|
||||
MTTError::NameNotFound(data) => assert_eq!(data, &name),
|
||||
_ => unreachable!("got {:?}: should have been document field not found.", err),
|
||||
},
|
||||
_ => unreachable!("got {:?}: should have been an error", result.get_action()),
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#[test]
|
||||
fn errors_on_wrong_field_type() {
|
||||
let (docdef, doc_name) = create_docdef([FieldType::Uuid].to_vec());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user