Corrected external add document issue.
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:
10
tests/document_test.rs
Normal file
10
tests/document_test.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use morethantext::{action::*, MoreThanText, TestMoreThanText};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[test]
|
||||
fn is_document_created() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let doc_name = TestMoreThanText::random_name();
|
||||
let docdef = DocDef::new(doc_name.clone());
|
||||
mtt.create_document(docdef).unwrap();
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
use morethantext::{
|
||||
action::{DocDef, FieldType, Query},
|
||||
ErrorID, MTTError, MoreThanText, Name,
|
||||
};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[test]
|
||||
fn errors_on_missing_page() {
|
||||
let mtt = MoreThanText::new();
|
||||
let doc_name = "missing";
|
||||
match mtt.get_document(doc_name, "something") {
|
||||
Ok(data) => assert!(false, "got '{}', should have been not found error", data),
|
||||
Err(err) => {
|
||||
let err_id = err.error_id();
|
||||
match err_id {
|
||||
ErrorID::DocumentNotFound => {}
|
||||
_ => unreachable!("got {:?}, should have been not found", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn can_create_document() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let doc_name = Name::english(Uuid::new_v4().to_string().as_str());
|
||||
let mut docdef = DocDef::new(doc_name.clone());
|
||||
let field_name = Name::english(Uuid::new_v4().to_string().as_str());
|
||||
docdef.add_field(field_name.clone(), FieldType::Uuid);
|
||||
mtt.records(docdef);
|
||||
}
|
||||
Reference in New Issue
Block a user