2021-12-24 17:15:51 +03:00
|
|
|
|
mod common;
|
|
|
|
|
use common::*;
|
|
|
|
|
|
|
|
|
|
const COLLECTION: &str = "Ingest";
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn should_push_new_object_to_sonic() {
|
2021-12-24 23:43:47 +03:00
|
|
|
|
let bucket = "push_simple";
|
2021-12-24 17:15:51 +03:00
|
|
|
|
|
2021-12-24 23:43:47 +03:00
|
|
|
|
let ingest_channel = ingest_start();
|
|
|
|
|
match ingest_channel.push(COLLECTION, bucket, "1", "Sweet Teriyaki Beef Skewers") {
|
2021-12-24 17:15:51 +03:00
|
|
|
|
Ok(res) => assert!(res),
|
|
|
|
|
Err(_) => unreachable!(),
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-24 23:43:47 +03:00
|
|
|
|
flush_bucket(COLLECTION, bucket);
|
2021-12-24 17:15:51 +03:00
|
|
|
|
}
|
2021-12-24 17:26:28 +03:00
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn should_push_new_object_to_sonic_with_russian_locale() {
|
2021-12-24 23:43:47 +03:00
|
|
|
|
let bucket = "push_locale";
|
2021-12-24 17:26:28 +03:00
|
|
|
|
|
2021-12-24 23:43:47 +03:00
|
|
|
|
let ingest_channel = ingest_start();
|
2021-12-24 17:26:28 +03:00
|
|
|
|
match ingest_channel.push_with_locale(
|
|
|
|
|
COLLECTION,
|
2021-12-24 23:43:47 +03:00
|
|
|
|
bucket,
|
2021-12-24 17:26:28 +03:00
|
|
|
|
"1",
|
|
|
|
|
"Открытый пирог с орехами и сгущенкой",
|
|
|
|
|
"rus",
|
|
|
|
|
) {
|
|
|
|
|
Ok(res) => assert!(res),
|
|
|
|
|
Err(_) => unreachable!(),
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-24 23:43:47 +03:00
|
|
|
|
flush_bucket(COLLECTION, bucket);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn should_push_multiline_text() {
|
|
|
|
|
let bucket = "push_multiline";
|
|
|
|
|
let multiline_text = "
|
|
|
|
|
Sweet
|
|
|
|
|
Teriyaki
|
|
|
|
|
Beef
|
|
|
|
|
Skewers
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
let ingest_channel = ingest_start();
|
|
|
|
|
match ingest_channel.push(COLLECTION, bucket, "1", multiline_text) {
|
|
|
|
|
Ok(res) => assert!(res),
|
|
|
|
|
Err(_) => unreachable!(),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flush_bucket(COLLECTION, bucket);
|
2021-12-24 17:26:28 +03:00
|
|
|
|
}
|