Refactored session id.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 3s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 3s
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use morethantext::{
|
||||
action::{CalcValue, Calculation, Field, FieldType, Operand, Query, Record},
|
||||
action::{Addition, CalcValue, Calculation, Field, FieldType, Operand, Query, Record},
|
||||
MTTError, MoreThanText, Name,
|
||||
};
|
||||
use std::time::Duration;
|
||||
use uuid::Uuid;
|
||||
|
||||
fn doc_name() -> Name {
|
||||
Name::english("session")
|
||||
}
|
||||
|
||||
fn get_session(mtt: &mut MoreThanText, id: &Uuid) -> Result<Record, MTTError> {
|
||||
let doc_name = Name::english("session");
|
||||
let mut qry = Query::new(doc_name);
|
||||
let mut qry = Query::new(doc_name());
|
||||
let mut calc = Calculation::new(Operand::Equal);
|
||||
calc.add_value(CalcValue::Existing(FieldType::Uuid))
|
||||
.unwrap();
|
||||
@@ -72,3 +75,18 @@ fn is_expiration_date_set_in_the_future() {
|
||||
_ => unreachable!("got {:?} should have been date time", holder),
|
||||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "hangs without completing"]
|
||||
fn are_session_ids_unique_on_update() {
|
||||
let mut mtt = MoreThanText::new();
|
||||
let id = mtt.validate_session(None);
|
||||
let mut addition = Addition::new(doc_name());
|
||||
addition.add_field(Name::english("id"), id);
|
||||
match mtt.records(addition) {
|
||||
Ok(data) => unreachable!("got {:?} should have been error", data),
|
||||
Err(err) => match err {
|
||||
_ => unreachable!("got {:?}, should have been not unique", err),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user