Add search function to hydrus service
Signed-off-by: trivernis <trivernis@protonmail.com>pull/5/head
parent
2a297c0636
commit
9d80486662
@ -1,7 +1,8 @@
|
||||
mod test_address;
|
||||
mod test_files;
|
||||
mod test_hydrus;
|
||||
mod test_import;
|
||||
mod test_url;
|
||||
mod test_page;
|
||||
mod test_address;
|
||||
mod test_service;
|
||||
mod test_tags;
|
||||
mod test_url;
|
||||
|
@ -0,0 +1,27 @@
|
||||
use super::super::common;
|
||||
use hydrus_api::wrapper::service::{Service, ServiceType, Services};
|
||||
|
||||
async fn get_services() -> Services {
|
||||
let hydrus = common::get_hydrus();
|
||||
hydrus.services().await.unwrap()
|
||||
}
|
||||
|
||||
async fn get_file_service() -> Service {
|
||||
let services = get_services().await;
|
||||
services
|
||||
.get_services(ServiceType::LocalFiles)
|
||||
.pop()
|
||||
.unwrap()
|
||||
.clone()
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn it_searches_for_files() {
|
||||
let service = get_file_service().await;
|
||||
service
|
||||
.search()
|
||||
.add_tag("character:rimuru tempest".into())
|
||||
.run()
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
Loading…
Reference in New Issue