Moved Query into separate actions.
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:
@@ -1,19 +1,15 @@
|
||||
use morethantext::{MTTError, MoreThanText};
|
||||
|
||||
#[test]
|
||||
fn get_home_page() {
|
||||
let mtt = MoreThanText::new();
|
||||
match mtt.get_document("page", "home") {
|
||||
Ok(_) => {}
|
||||
Err(err) => assert!(false, "got error {:?}", err),
|
||||
}
|
||||
}
|
||||
use morethantext::{
|
||||
action::Query,
|
||||
document::{definition::DocDef, field::FieldType},
|
||||
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, "home") {
|
||||
match mtt.get_document(doc_name, "something") {
|
||||
Ok(data) => assert!(false, "got '{}', should have been not found error", data),
|
||||
Err(err) => match err {
|
||||
MTTError::DocumentNotFound(result) => assert_eq!(result, doc_name),
|
||||
@@ -21,3 +17,13 @@ fn errors_on_missing_page() {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
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.request(docdef);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user